Logo Search packages:      
Sourcecode: pcsc-lite version File versions  Download package

int SYS_ThreadJoin ( HANDLE *  thread,
void **  retval 
)

Returns: nonzero for success, 0 for failure.

Definition at line 123 of file thread_win32.c.

References INFINITE.

{
    DWORD status;
    BOOL rv;

    /* go to sleep waiting for the thread to exit */
    if( WaitForSingleObject(*thread, INFINITE) == WAIT_FAILED ) {
        return 0;
    }
    if( retval != NULL ) {
        rv = GetExitCodeThread(*thread, &status);
        if( rv == 0 ) {
            /* the call failed */
            return 0;
        }
        *retval = (void *)status;
    }
    /* success */
    CloseHandle(*thread);
    *thread = NULL;
    return 1;
}


Generated by  Doxygen 1.6.0   Back to index