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

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/pr/src/threads/combined/prulock.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:
66
66
    PR_ASSERT(cpu);   /* Global threads don't have CPUs */
67
67
    PR_ASSERT(_PR_MD_GET_INTSOFF() > 0);
68
68
        me = _PR_MD_CURRENT_THREAD();
69
 
#if !defined(XP_MAC)
70
69
    PR_ASSERT(!(me->flags & _PR_IDLE_THREAD));
71
 
#endif
72
70
 
73
71
    /*
74
72
    ** Process delayed interrupts. This logic is kinda scary because we
92
90
            cpu->u.missed[i] = 0;
93
91
            for (it = _pr_interruptTable; it->name; it++) {
94
92
                if (missed & it->missed_bit) {
95
 
#ifndef XP_MAC
96
93
                    PR_LOG(_pr_sched_lm, PR_LOG_MIN,
97
94
                           ("IntsOn[0]: %s intr", it->name));
98
 
#endif
99
95
                    (*it->handler)();
100
96
                }
101
97
            }
230
226
    PRCList *q;
231
227
 
232
228
    PR_ASSERT(me != suspendAllThread); 
233
 
#if !defined(XP_MAC)
234
229
    PR_ASSERT(!(me->flags & _PR_IDLE_THREAD));
235
 
#endif
236
230
    PR_ASSERT(lock != NULL);
237
231
#ifdef _PR_GLOBAL_THREADS_ONLY 
238
232
    PR_ASSERT(lock->owner != me);
343
337
    PR_ASSERT(lock != NULL);
344
338
    PR_ASSERT(lock->owner == me);
345
339
    PR_ASSERT(me != suspendAllThread); 
346
 
#if !defined(XP_MAC)
347
340
    PR_ASSERT(!(me->flags & _PR_IDLE_THREAD));
348
 
#endif
349
341
    if (lock->owner != me) {
350
342
        return PR_FAILURE;
351
343
    }
404
396
}
405
397
 
406
398
/*
 
399
**  If the current thread owns |lock|, this assertion is guaranteed to
 
400
**  succeed.  Otherwise, the behavior of this function is undefined.
 
401
*/
 
402
PR_IMPLEMENT(void) PR_AssertCurrentThreadOwnsLock(PRLock *lock)
 
403
{
 
404
    PRThread *me = _PR_MD_CURRENT_THREAD();
 
405
    PR_ASSERT(lock->owner == me);
 
406
}
 
407
 
 
408
/*
407
409
** Test and then lock the lock if it's not already locked by some other
408
410
** thread. Return PR_FALSE if some other thread owned the lock at the
409
411
** time of the call.