(file) Return to recursivelock.c CVS log (file) (dir) Up to [OMI] / omi / pal

 1 krisbash 1.1 #include "lock.h"
 2              #include "thread.h"
 3              
 4              void RecursiveLock_Acquire(
 5                  _Inout_ RecursiveLock* self
 6              )
 7              {
 8                  ThreadID me = Thread_ID();
 9              
10                  if (self->count > 0)
11                  {
12                      if (Thread_Equal(&me, &self->owner) != 0)
13                      {
14                          self->count++;
15                          return;
16                      }
17                  }
18              
19                  Lock_Acquire(&self->lock);
20                  self->owner = me;
21                  self->count = 1;
22 krisbash 1.1 }

ViewCVS 0.9.2