use_starpu_pthread_macros.cocci 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // StarPU --- Runtime system for heterogeneous multicore architectures.
  2. //
  3. // Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
  4. // Copyright (C) 2011 Centre National de la Recherche Scientifique
  5. //
  6. // StarPU is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Lesser General Public License as published by
  8. // the Free Software Foundation; either version 2.1 of the License, or (at
  9. // your option) any later version.
  10. //
  11. // StarPU is distributed in the hope that it will be useful, but
  12. // WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. //
  15. // See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. @pthread_mutex_@
  17. expression E1, E2;
  18. @@
  19. (
  20. - pthread_mutex_init(E1, E2);
  21. + _STARPU_PTHREAD_MUTEX_INIT(E1, E2);
  22. |
  23. - pthread_mutex_lock(E1);
  24. + _STARPU_PTHREAD_MUTEX_LOCK(E1);
  25. |
  26. - pthread_mutex_unlock(E1);
  27. + _STARPU_PTHREAD_MUTEX_UNLOCK(E1);
  28. |
  29. - pthread_mutex_destroy(E1);
  30. + _STARPU_PTHREAD_MUTEX_DESTROY(E1);
  31. )
  32. @pthread_rwlock_@
  33. expression E;
  34. @@
  35. (
  36. - pthread_rwlock_init(E);
  37. + _STARPU_PTHREAD_RWLOCK_INIT(E);
  38. |
  39. - pthread_rwlock_rdlock(E);
  40. + _STARPU_PTHREAD_RWLOCK_RDLOCK(E);
  41. |
  42. - pthread_rwlock_wrlock(E);
  43. + _STARPU_PTHREAD_RWLOCK_WRLOCK(E);
  44. |
  45. - pthread_rwlock_unlock(E);
  46. + _STARPU_PTHREAD_RWLOCK_UNLOCK(E);
  47. |
  48. - pthread_rwlock_destroy(E);
  49. + _STARPU_PTHREAD_RWLOCK_DESTROY(E);
  50. )
  51. @pthread_cond_@
  52. expression E1, E2;
  53. @@
  54. (
  55. - pthread_cond_init(E1, E2);
  56. + _STARPU_PTHREAD_COND_INIT(E1, E2);
  57. |
  58. - pthread_cond_signal(E1);
  59. + _STARPU_PTHREAD_COND_SIGNAL(E1);
  60. |
  61. - pthread_cond_broadcast(E1);
  62. + _STARPU_PTHREAD_COND_BROADCAST(E1);
  63. |
  64. - pthread_cond_wait(E1, E2);
  65. + _STARPU_PTHREAD_COND_WAIT(E1, E2);
  66. |
  67. - pthread_cond_destroy(E1);
  68. + _STARPU_PTHREAD_COND_DESTROY(E1);
  69. )
  70. @pthread_barrier_@
  71. expression E1, E2, E3;
  72. @@
  73. (
  74. - pthread_barrier_init(E1, E2, E3);
  75. + _STARPU_PTHREAD_BARRIER_INIT(E1, E2, E3);
  76. |
  77. - pthread_barrier_wait(E1);
  78. + _STARPU_PTHREAD_BARRIER_WAIT(E1);
  79. |
  80. - pthread_barrier_destroy(E1);
  81. + _STARPU_PTHREAD_BARRIER_DESTROY(E1);
  82. )
  83. @pthread_spin_@
  84. expression E1;
  85. @@
  86. (
  87. - pthread_spin_destroy(E1);
  88. + _STARPU_PTHREAD_SPIN_DESTROY(E1);
  89. |
  90. - pthread_spin_lock(E1);
  91. + _STARPU_PTHREAD_SPIN_LOCK(E1);
  92. |
  93. - pthread_spin_unlock(E1);
  94. + _STARPU_PTHREAD_SPIN_UNLOCK(E1);
  95. )