~ubuntu-branches/debian/wheezy/courier/wheezy

« back to all changes in this revision

Viewing changes to pcp/intl/lock.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Hornburg (Racke)
  • Date: 2009-03-08 16:42:08 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090308164208-nlve2wtx9bbrulmd
Tags: 0.61.2-1
* New upstream release.
* Lintian:
  - fix chown in courier-webadmin postinst
  - removed courier-base preinst
  - added debhelper token to courier-mta.preinst
  - removed *.conffiles

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Locking in multithreaded situations.
2
 
   Copyright (C) 2005-2006 Free Software Foundation, Inc.
 
2
   Copyright (C) 2005-2007 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify it
5
5
   under the terms of the GNU Library General Public License as published
148
148
# define gl_lock_initializer \
149
149
    PTHREAD_MUTEX_INITIALIZER
150
150
# define gl_lock_init(NAME) \
151
 
    if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort ()
 
151
    do                                                                  \
 
152
      {                                                                 \
 
153
        if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \
 
154
          abort ();                                                     \
 
155
      }                                                                 \
 
156
    while (0)
152
157
# define gl_lock_lock(NAME) \
153
 
    if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort ()
 
158
    do                                                            \
 
159
      {                                                           \
 
160
        if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \
 
161
          abort ();                                               \
 
162
      }                                                           \
 
163
    while (0)
154
164
# define gl_lock_unlock(NAME) \
155
 
    if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort ()
 
165
    do                                                              \
 
166
      {                                                             \
 
167
        if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \
 
168
          abort ();                                                 \
 
169
      }                                                             \
 
170
    while (0)
156
171
# define gl_lock_destroy(NAME) \
157
 
    if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort ()
 
172
    do                                                               \
 
173
      {                                                              \
 
174
        if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \
 
175
          abort ();                                                  \
 
176
      }                                                              \
 
177
    while (0)
158
178
 
159
179
/* ------------------------- gl_rwlock_t datatype ------------------------- */
160
180
 
170
190
#   define gl_rwlock_initializer \
171
191
      PTHREAD_RWLOCK_INITIALIZER
172
192
#   define gl_rwlock_init(NAME) \
173
 
      if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) abort ()
 
193
      do                                                                   \
 
194
        {                                                                  \
 
195
          if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) \
 
196
            abort ();                                                      \
 
197
        }                                                                  \
 
198
      while (0)
174
199
#   define gl_rwlock_rdlock(NAME) \
175
 
      if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) abort ()
 
200
      do                                                               \
 
201
        {                                                              \
 
202
          if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) \
 
203
            abort ();                                                  \
 
204
        }                                                              \
 
205
      while (0)
176
206
#   define gl_rwlock_wrlock(NAME) \
177
 
      if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) abort ()
 
207
      do                                                               \
 
208
        {                                                              \
 
209
          if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) \
 
210
            abort ();                                                  \
 
211
        }                                                              \
 
212
      while (0)
178
213
#   define gl_rwlock_unlock(NAME) \
179
 
      if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) abort ()
 
214
      do                                                               \
 
215
        {                                                              \
 
216
          if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) \
 
217
            abort ();                                                  \
 
218
        }                                                              \
 
219
      while (0)
180
220
#   define gl_rwlock_destroy(NAME) \
181
 
      if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) abort ()
 
221
      do                                                                \
 
222
        {                                                               \
 
223
          if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) \
 
224
            abort ();                                                   \
 
225
        }                                                               \
 
226
      while (0)
182
227
 
183
228
#  else
184
229
 
196
241
#   define gl_rwlock_initializer \
197
242
      { 0, PTHREAD_MUTEX_INITIALIZER }
198
243
#   define gl_rwlock_init(NAME) \
199
 
      if (pthread_in_use ()) glthread_rwlock_init (&NAME)
 
244
      do                                  \
 
245
        {                                 \
 
246
          if (pthread_in_use ())          \
 
247
            glthread_rwlock_init (&NAME); \
 
248
        }                                 \
 
249
      while (0)
200
250
#   define gl_rwlock_rdlock(NAME) \
201
 
      if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME)
 
251
      do                                    \
 
252
        {                                   \
 
253
          if (pthread_in_use ())            \
 
254
            glthread_rwlock_rdlock (&NAME); \
 
255
        }                                   \
 
256
      while (0)
202
257
#   define gl_rwlock_wrlock(NAME) \
203
 
      if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME)
 
258
      do                                    \
 
259
        {                                   \
 
260
          if (pthread_in_use ())            \
 
261
            glthread_rwlock_wrlock (&NAME); \
 
262
        }                                   \
 
263
      while (0)
204
264
#   define gl_rwlock_unlock(NAME) \
205
 
      if (pthread_in_use ()) glthread_rwlock_unlock (&NAME)
 
265
      do                                    \
 
266
        {                                   \
 
267
          if (pthread_in_use ())            \
 
268
            glthread_rwlock_unlock (&NAME); \
 
269
        }                                   \
 
270
      while (0)
206
271
#   define gl_rwlock_destroy(NAME) \
207
 
      if (pthread_in_use ()) glthread_rwlock_destroy (&NAME)
 
272
      do                                     \
 
273
        {                                    \
 
274
          if (pthread_in_use ())             \
 
275
            glthread_rwlock_destroy (&NAME); \
 
276
        }                                    \
 
277
      while (0)
208
278
extern void glthread_rwlock_init (gl_rwlock_t *lock);
209
279
extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
210
280
extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
231
301
# define gl_rwlock_initializer \
232
302
    { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
233
303
# define gl_rwlock_init(NAME) \
234
 
    if (pthread_in_use ()) glthread_rwlock_init (&NAME)
 
304
    do                                  \
 
305
      {                                 \
 
306
        if (pthread_in_use ())          \
 
307
          glthread_rwlock_init (&NAME); \
 
308
      }                                 \
 
309
    while (0)
235
310
# define gl_rwlock_rdlock(NAME) \
236
 
    if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME)
 
311
    do                                    \
 
312
      {                                   \
 
313
        if (pthread_in_use ())            \
 
314
          glthread_rwlock_rdlock (&NAME); \
 
315
      }                                   \
 
316
    while (0)
237
317
# define gl_rwlock_wrlock(NAME) \
238
 
    if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME)
 
318
    do                                    \
 
319
      {                                   \
 
320
        if (pthread_in_use ())            \
 
321
          glthread_rwlock_wrlock (&NAME); \
 
322
      }                                   \
 
323
    while (0)
239
324
# define gl_rwlock_unlock(NAME) \
240
 
    if (pthread_in_use ()) glthread_rwlock_unlock (&NAME)
 
325
    do                                    \
 
326
      {                                   \
 
327
        if (pthread_in_use ())            \
 
328
          glthread_rwlock_unlock (&NAME); \
 
329
      }                                   \
 
330
    while (0)
241
331
# define gl_rwlock_destroy(NAME) \
242
 
    if (pthread_in_use ()) glthread_rwlock_destroy (&NAME)
 
332
    do                                     \
 
333
      {                                    \
 
334
        if (pthread_in_use ())             \
 
335
          glthread_rwlock_destroy (&NAME); \
 
336
      }                                    \
 
337
    while (0)
243
338
extern void glthread_rwlock_init (gl_rwlock_t *lock);
244
339
extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
245
340
extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
267
362
       PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
268
363
#   endif
269
364
#   define gl_recursive_lock_init(NAME) \
270
 
      if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort ()
 
365
      do                                                                  \
 
366
        {                                                                 \
 
367
          if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \
 
368
            abort ();                                                     \
 
369
        }                                                                 \
 
370
      while (0)
271
371
#   define gl_recursive_lock_lock(NAME) \
272
 
      if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort ()
 
372
      do                                                            \
 
373
        {                                                           \
 
374
          if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \
 
375
            abort ();                                               \
 
376
        }                                                           \
 
377
      while (0)
273
378
#   define gl_recursive_lock_unlock(NAME) \
274
 
      if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort ()
 
379
      do                                                              \
 
380
        {                                                             \
 
381
          if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \
 
382
            abort ();                                                 \
 
383
        }                                                             \
 
384
      while (0)
275
385
#   define gl_recursive_lock_destroy(NAME) \
276
 
      if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort ()
 
386
      do                                                               \
 
387
        {                                                              \
 
388
          if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \
 
389
            abort ();                                                  \
 
390
        }                                                              \
 
391
      while (0)
277
392
 
278
393
#  else
279
394
 
291
406
#   define gl_recursive_lock_initializer \
292
407
      { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 }
293
408
#   define gl_recursive_lock_init(NAME) \
294
 
      if (pthread_in_use ()) glthread_recursive_lock_init (&NAME)
 
409
      do                                          \
 
410
        {                                         \
 
411
          if (pthread_in_use ())                  \
 
412
            glthread_recursive_lock_init (&NAME); \
 
413
        }                                         \
 
414
      while (0)
295
415
#   define gl_recursive_lock_lock(NAME) \
296
 
      if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME)
 
416
      do                                          \
 
417
        {                                         \
 
418
          if (pthread_in_use ())                  \
 
419
            glthread_recursive_lock_lock (&NAME); \
 
420
        }                                         \
 
421
      while (0)
297
422
#   define gl_recursive_lock_unlock(NAME) \
298
 
      if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME)
 
423
      do                                            \
 
424
        {                                           \
 
425
          if (pthread_in_use ())                    \
 
426
            glthread_recursive_lock_unlock (&NAME); \
 
427
        }                                           \
 
428
      while (0)
299
429
#   define gl_recursive_lock_destroy(NAME) \
300
 
      if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME)
 
430
      do                                             \
 
431
        {                                            \
 
432
          if (pthread_in_use ())                     \
 
433
            glthread_recursive_lock_destroy (&NAME); \
 
434
        }                                            \
 
435
      while (0)
301
436
extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
302
437
extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
303
438
extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
324
459
#  define gl_recursive_lock_initializer \
325
460
     { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 }
326
461
#  define gl_recursive_lock_init(NAME) \
327
 
     if (pthread_in_use ()) glthread_recursive_lock_init (&NAME)
 
462
     do                                          \
 
463
       {                                         \
 
464
         if (pthread_in_use ())                  \
 
465
           glthread_recursive_lock_init (&NAME); \
 
466
       }                                         \
 
467
     while (0)
328
468
#  define gl_recursive_lock_lock(NAME) \
329
 
     if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME)
 
469
     do                                          \
 
470
       {                                         \
 
471
         if (pthread_in_use ())                  \
 
472
           glthread_recursive_lock_lock (&NAME); \
 
473
       }                                         \
 
474
     while (0)
330
475
#  define gl_recursive_lock_unlock(NAME) \
331
 
     if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME)
 
476
     do                                            \
 
477
       {                                           \
 
478
         if (pthread_in_use ())                    \
 
479
           glthread_recursive_lock_unlock (&NAME); \
 
480
       }                                           \
 
481
     while (0)
332
482
#  define gl_recursive_lock_destroy(NAME) \
333
 
     if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME)
 
483
     do                                             \
 
484
       {                                            \
 
485
         if (pthread_in_use ())                     \
 
486
           glthread_recursive_lock_destroy (&NAME); \
 
487
       }                                            \
 
488
     while (0)
334
489
extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
335
490
extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
336
491
extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
410
565
# define gl_lock_initializer \
411
566
    PTH_MUTEX_INIT
412
567
# define gl_lock_init(NAME) \
413
 
    if (pth_in_use() && !pth_mutex_init (&NAME)) abort ()
 
568
    do                                               \
 
569
      {                                              \
 
570
        if (pth_in_use() && !pth_mutex_init (&NAME)) \
 
571
          abort ();                                  \
 
572
      }                                              \
 
573
    while (0)
414
574
# define gl_lock_lock(NAME) \
415
 
    if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort ()
 
575
    do                                                           \
 
576
      {                                                          \
 
577
        if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \
 
578
          abort ();                                              \
 
579
      }                                                          \
 
580
    while (0)
416
581
# define gl_lock_unlock(NAME) \
417
 
    if (pth_in_use() && !pth_mutex_release (&NAME)) abort ()
 
582
    do                                                  \
 
583
      {                                                 \
 
584
        if (pth_in_use() && !pth_mutex_release (&NAME)) \
 
585
          abort ();                                     \
 
586
      }                                                 \
 
587
    while (0)
418
588
# define gl_lock_destroy(NAME) \
419
589
    (void)(&NAME)
420
590
 
428
598
#  define gl_rwlock_initializer \
429
599
     PTH_RWLOCK_INIT
430
600
#  define gl_rwlock_init(NAME) \
431
 
     if (pth_in_use() && !pth_rwlock_init (&NAME)) abort ()
 
601
     do                                                \
 
602
       {                                               \
 
603
         if (pth_in_use() && !pth_rwlock_init (&NAME)) \
 
604
           abort ();                                   \
 
605
       }                                               \
 
606
     while (0)
432
607
#  define gl_rwlock_rdlock(NAME) \
433
 
     if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort ()
 
608
     do                                                              \
 
609
       {                                                             \
 
610
         if (pth_in_use()                                            \
 
611
             && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) \
 
612
           abort ();                                                 \
 
613
       }                                                             \
 
614
     while (0)
434
615
#  define gl_rwlock_wrlock(NAME) \
435
 
     if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort ()
 
616
     do                                                              \
 
617
       {                                                             \
 
618
         if (pth_in_use()                                            \
 
619
             && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) \
 
620
           abort ();                                                 \
 
621
       }                                                             \
 
622
     while (0)
436
623
#  define gl_rwlock_unlock(NAME) \
437
 
     if (pth_in_use() && !pth_rwlock_release (&NAME)) abort ()
 
624
     do                                                   \
 
625
       {                                                  \
 
626
         if (pth_in_use() && !pth_rwlock_release (&NAME)) \
 
627
           abort ();                                      \
 
628
       }                                                  \
 
629
     while (0)
438
630
#  define gl_rwlock_destroy(NAME) \
439
631
     (void)(&NAME)
440
632
 
449
641
#  define gl_recursive_lock_initializer \
450
642
     PTH_MUTEX_INIT
451
643
#  define gl_recursive_lock_init(NAME) \
452
 
     if (pth_in_use() && !pth_mutex_init (&NAME)) abort ()
 
644
     do                                               \
 
645
       {                                              \
 
646
         if (pth_in_use() && !pth_mutex_init (&NAME)) \
 
647
           abort ();                                  \
 
648
       }                                              \
 
649
     while (0)
453
650
#  define gl_recursive_lock_lock(NAME) \
454
 
     if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort ()
 
651
     do                                                           \
 
652
       {                                                          \
 
653
         if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \
 
654
           abort ();                                              \
 
655
       }                                                          \
 
656
     while (0)
455
657
#  define gl_recursive_lock_unlock(NAME) \
456
 
     if (pth_in_use() && !pth_mutex_release (&NAME)) abort ()
 
658
     do                                                  \
 
659
       {                                                 \
 
660
         if (pth_in_use() && !pth_mutex_release (&NAME)) \
 
661
           abort ();                                     \
 
662
       }                                                 \
 
663
     while (0)
457
664
#  define gl_recursive_lock_destroy(NAME) \
458
665
     (void)(&NAME)
459
666
 
535
742
# define gl_lock_initializer \
536
743
    DEFAULTMUTEX
537
744
# define gl_lock_init(NAME) \
538
 
    if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) abort ()
 
745
    do                                                                       \
 
746
      {                                                                      \
 
747
        if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) \
 
748
          abort ();                                                          \
 
749
      }                                                                      \
 
750
    while (0)
539
751
# define gl_lock_lock(NAME) \
540
 
    if (thread_in_use () && mutex_lock (&NAME) != 0) abort ()
 
752
    do                                                   \
 
753
      {                                                  \
 
754
        if (thread_in_use () && mutex_lock (&NAME) != 0) \
 
755
          abort ();                                      \
 
756
      }                                                  \
 
757
    while (0)
541
758
# define gl_lock_unlock(NAME) \
542
 
    if (thread_in_use () && mutex_unlock (&NAME) != 0) abort ()
 
759
    do                                                     \
 
760
      {                                                    \
 
761
        if (thread_in_use () && mutex_unlock (&NAME) != 0) \
 
762
          abort ();                                        \
 
763
      }                                                    \
 
764
    while (0)
543
765
# define gl_lock_destroy(NAME) \
544
 
    if (thread_in_use () && mutex_destroy (&NAME) != 0) abort ()
 
766
    do                                                      \
 
767
      {                                                     \
 
768
        if (thread_in_use () && mutex_destroy (&NAME) != 0) \
 
769
          abort ();                                         \
 
770
      }                                                     \
 
771
    while (0)
545
772
 
546
773
/* ------------------------- gl_rwlock_t datatype ------------------------- */
547
774
 
553
780
# define gl_rwlock_initializer \
554
781
    DEFAULTRWLOCK
555
782
# define gl_rwlock_init(NAME) \
556
 
    if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) abort ()
 
783
    do                                                                        \
 
784
      {                                                                       \
 
785
        if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) \
 
786
          abort ();                                                           \
 
787
      }                                                                       \
 
788
    while (0)
557
789
# define gl_rwlock_rdlock(NAME) \
558
 
    if (thread_in_use () && rw_rdlock (&NAME) != 0) abort ()
 
790
    do                                                  \
 
791
      {                                                 \
 
792
        if (thread_in_use () && rw_rdlock (&NAME) != 0) \
 
793
          abort ();                                     \
 
794
      }                                                 \
 
795
    while (0)
559
796
# define gl_rwlock_wrlock(NAME) \
560
 
    if (thread_in_use () && rw_wrlock (&NAME) != 0) abort ()
 
797
    do                                                  \
 
798
      {                                                 \
 
799
        if (thread_in_use () && rw_wrlock (&NAME) != 0) \
 
800
          abort ();                                     \
 
801
      }                                                 \
 
802
    while (0)
561
803
# define gl_rwlock_unlock(NAME) \
562
 
    if (thread_in_use () && rw_unlock (&NAME) != 0) abort ()
 
804
    do                                                  \
 
805
      {                                                 \
 
806
        if (thread_in_use () && rw_unlock (&NAME) != 0) \
 
807
          abort ();                                     \
 
808
      }                                                 \
 
809
    while (0)
563
810
# define gl_rwlock_destroy(NAME) \
564
 
    if (thread_in_use () && rwlock_destroy (&NAME) != 0) abort ()
 
811
    do                                                       \
 
812
      {                                                      \
 
813
        if (thread_in_use () && rwlock_destroy (&NAME) != 0) \
 
814
          abort ();                                          \
 
815
      }                                                      \
 
816
    while (0)
565
817
 
566
818
/* --------------------- gl_recursive_lock_t datatype --------------------- */
567
819
 
582
834
# define gl_recursive_lock_initializer \
583
835
    { DEFAULTMUTEX, (thread_t) 0, 0 }
584
836
# define gl_recursive_lock_init(NAME) \
585
 
    if (thread_in_use ()) glthread_recursive_lock_init (&NAME)
 
837
    do                                          \
 
838
      {                                         \
 
839
        if (thread_in_use ())                   \
 
840
          glthread_recursive_lock_init (&NAME); \
 
841
      }                                         \
 
842
    while (0)
586
843
# define gl_recursive_lock_lock(NAME) \
587
 
    if (thread_in_use ()) glthread_recursive_lock_lock (&NAME)
 
844
    do                                          \
 
845
      {                                         \
 
846
        if (thread_in_use ())                   \
 
847
          glthread_recursive_lock_lock (&NAME); \
 
848
      }                                         \
 
849
    while (0)
588
850
# define gl_recursive_lock_unlock(NAME) \
589
 
    if (thread_in_use ()) glthread_recursive_lock_unlock (&NAME)
 
851
    do                                            \
 
852
      {                                           \
 
853
        if (thread_in_use ())                     \
 
854
          glthread_recursive_lock_unlock (&NAME); \
 
855
      }                                           \
 
856
    while (0)
590
857
# define gl_recursive_lock_destroy(NAME) \
591
 
    if (thread_in_use ()) glthread_recursive_lock_destroy (&NAME)
 
858
    do                                             \
 
859
      {                                            \
 
860
        if (thread_in_use ())                      \
 
861
          glthread_recursive_lock_destroy (&NAME); \
 
862
      }                                            \
 
863
    while (0)
592
864
extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
593
865
extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
594
866
extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);