srv_yield

Description

Allow another thread to run.

Syntax

CS_RETCODE srv_yield()

Returns

None.

Examples

Example 1

#include   <stdio.h>
#include   <ospublic.h>

/*
** Local Prototype.
*/
CS_RETCODE ex_srv_yield PROTOTYPE((
    ));
/* 
** EX_SRV_YIELD
**
**   Example routine to suspend the current thread.
** Arguments:
**    None.
**
** Returns:
**
**    CS_SUCCEED
**    CS_FAIL
*/
CS_RETCODE    ex_srv_yield()
{
    printf(“I’ll wait this one out...\n”);
    if (srv_yield() == CS_FAIL)
    {
        printf(“srv_yield() failed.\n”);
        return(CS_FAIL);
    }
    else
    {
        printf(“I’m back!\n”);
        return(CS_SUCCEED);
    }
}

Usage

See also

srv_sleep, srv_wakeup