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

File: [OMI] / omi / pal / recursivelock.c (download)
Revision: 1.1, Mon Apr 20 17:19:55 2015 UTC (9 years ago) by krisbash
Branch: MAIN
CVS Tags: OMI_1_0_8_2, OMI_1_0_8_1, HEAD
OMI 1.0.8-1

#include "lock.h"
#include "thread.h"

void RecursiveLock_Acquire(
    _Inout_ RecursiveLock* self
)
{
    ThreadID me = Thread_ID();

    if (self->count > 0)
    {
        if (Thread_Equal(&me, &self->owner) != 0)
        {
            self->count++;
            return;
        }
    }

    Lock_Acquire(&self->lock);
    self->owner = me;
    self->count = 1;
}

ViewCVS 0.9.2