~ubuntu-branches/ubuntu/saucy/nspr/saucy-updates

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/pr/src/pthreads/ptsynch.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2009-08-10 11:34:26 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090810113426-3uv4diflrkcbdimm
Tags: 4.8-0ubuntu1
* New upstream release: 4.8 (LP: #387812)
* adjust patches to changed upstreanm codebase
  - update debian/patches/99_configure.patch
* update shlibs symbols to include new API elements
  - update debian/libnspr4-0d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
    PR_ASSERT(0 == lock->notified.length);
209
209
    PR_ASSERT(NULL == lock->notified.link);
210
210
    PR_ASSERT(PR_FALSE == lock->locked);
 
211
    /* Nb: the order of the next two statements is not critical to
 
212
     * the correctness of PR_AssertCurrentThreadOwnsLock(), but 
 
213
     * this particular order makes the assertion more likely to
 
214
     * catch errors. */
 
215
    lock->owner = pthread_self();
211
216
    lock->locked = PR_TRUE;
212
 
    lock->owner = pthread_self();
213
217
#if defined(DEBUG)
214
218
    pt_debug.locks_acquired += 1;
215
219
#endif
241
245
    return PR_SUCCESS;
242
246
}  /* PR_Unlock */
243
247
 
 
248
PR_IMPLEMENT(void) PR_AssertCurrentThreadOwnsLock(PRLock *lock)
 
249
{
 
250
    /* Nb: the order of the |locked| and |owner==me| checks is not critical 
 
251
     * to the correctness of PR_AssertCurrentThreadOwnsLock(), but 
 
252
     * this particular order makes the assertion more likely to
 
253
     * catch errors. */
 
254
    PR_ASSERT(lock->locked && pthread_equal(lock->owner, pthread_self()));
 
255
}
244
256
 
245
257
/**************************************************************/
246
258
/**************************************************************/
516
528
    return 0;
517
529
}
518
530
 
 
531
PR_IMPLEMENT(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon)
 
532
{
 
533
    PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(&mon->lock);
 
534
}
 
535
 
519
536
PR_IMPLEMENT(void) PR_EnterMonitor(PRMonitor *mon)
520
537
{
521
538
    pthread_t self = pthread_self();