Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

int kLdrDyldSemInit ( void   ) 

Initializes the loader semaphore.

Returns:
0 on success, non-zero OS status code on failure.

Definition at line 82 of file kLdrDyldSem.c.

References g_Semaphore, and NULL.

Referenced by kldrInit().

{
#if K_OS == K_OS_DARWIN
    kern_return_t krc;

    krc = semaphore_create(mach_task_self(), &g_Semaphore, SYNC_POLICY_FIFO, 0);
    if (krc != KERN_SUCCESS)
        return krc;

#elif K_OS == K_OS_OS2
    APIRET rc;
    g_hmtx = NULLHANDLE;
    rc = DosCreateMutexSem(NULL, &g_hmtx, 0, FALSE);
    if (rc)
        return rc;

#elif  K_OS == K_OS_WINDOWS
    InitializeCriticalSection(&g_CritSect);

#else
# error "port me"
#endif
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index