srv_ucwakeup

Description

Unconditionally wake up a sleeping thread.

Syntax

CS_RETCODE srv_ucwakeup(spp, wakeflags)
SRV_PROC     *spp;
CS_INT             wakeflags;

Parameters

spp

A pointer to an internal thread control structure.

wakeflags

A bit mask that modifies the way srv_ucwakeup behaves. Just one flag is defined; set wakeflags to 0 if it is not used.

SRV_M_WAKE_INTR

This flag indicates that the call to srv_ucwakeup is from interrupt level code. Failure to set this flag when calling srv_ucwakeup from interrupt level code can cause the Open Server application to behave erratically.

Returns

Table 3-147: Return values (srv_ucwakeup)

Returns

To indicate

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed, because the thread does not exist or was not sleeping.

Examples

Example 1

&num;include <ospublic.h>
/*
** Local Protoype.
*/CS_RETCODE      ex_srv_ucwakeup PROTOTYPE((
SRV_PROC        *sproc
));

/*
** EX_SRV_PROC
** An example routine to wake up a sleeping thread from
** a non-interrupt level by using srv_ucwakeup.
**
** Arguments:
** sproc   A pointer to an internal thread control
** structure.
**
** Returns:
** CS_SUCCEED  The specified thread was woken up.
** CS_FAIL      An error was detected.
*/

CS_RETCODE      ex_srv_ucwakeup(sproc)
SRV_PROC        *sproc;
{
/* Wake up the specified thread. */
return( srv_ucwakeup(sproc, 0));
}

Usage

See also

srv_sleep, srv_wakeup, srv_yield