*p_mutex = CreateMutex( 0, FALSE, 0 );
return (*p_mutex != NULL) ? 0 : ENOMEM;
-#elif defined( HAVE_KERNEL_SCHEDULER_H )
- /* check the arguments and whether it's already been initialized */
- if( p_mutex == NULL )
- {
- return B_BAD_VALUE;
- }
-
- if( p_mutex->init == 9999 )
- {
- return EALREADY;
- }
-
- p_mutex->lock = create_sem( 1, "BeMutex" );
- if( p_mutex->lock < B_NO_ERROR )
- {
- return( -1 );
- }
-
- p_mutex->init = 9999;
- return B_OK;
-
#endif
}
CloseHandle( *p_mutex );
-#elif defined( HAVE_KERNEL_SCHEDULER_H )
- if( p_mutex->init == 9999 )
- delete_sem( p_mutex->lock );
-
- p_mutex->init = 0;
-
#endif
}
NULL ); /* unnamed */
return *p_condvar ? 0 : ENOMEM;
-#elif defined( HAVE_KERNEL_SCHEDULER_H )
- if( !p_condvar )
- {
- return B_BAD_VALUE;
- }
-
- if( p_condvar->init == 9999 )
- {
- return EALREADY;
- }
-
- p_condvar->thread = -1;
- p_condvar->init = 9999;
- return 0;
-
#endif
}
CloseHandle( *p_condvar );
-#elif defined( HAVE_KERNEL_SCHEDULER_H )
- p_condvar->init = 0;
-
#endif
}
free (th);
}
-#elif defined( HAVE_KERNEL_SCHEDULER_H )
- *p_handle = spawn_thread( entry, psz_name, priority, data );
- ret = resume_thread( *p_handle );
-
#endif
return ret;
}
*result = handle->data;
free (handle);
-#elif defined( HAVE_KERNEL_SCHEDULER_H )
- int32_t exit_value;
- int val = (B_OK == wait_for_thread( p_priv->thread_id, &exit_value ));
- if( !val && result )
- *result = (void *)exit_value;
-
#endif
}