gtpc2m8jC/C++ Language Support User's Guide

tpf_sawnc-Wait for Event Completion with Signal Awareness

This function waits for a named event to be completed and is similar to the evnwc function; however, if the caller of the tpf_sawnc function has to wait for an event to be completed, the caller can be interrupted by a signal. The tpf_sawnc function is used with the evntc and postc functions.

Format

#include   <tpfapi.h>
int tpf_sawnc(struct ev0bk *evninf, enum t_evn_typ type);      

evninf
A pointer to the tpf_sawnc parameter block. See the ev0bk and tpf_ev0bk_list_data structures for more information about the tpf_sawnc parameter block.

type
The type of event being completed. The argument must belong to the enumerated type t_evn_typ, which is defined in the tpfapi.h header file. Use one of the following predefined terms:

EVENT_MSK
for mask events.

EVENT_CNT
for count events.

EVENT_CB_Dx
where x is a single hexadecimal digit (0-F) for core events.

EVENT_LIST
for list events.

Normal Return

An integer value of 0.

Error Return

One of the following:

Programming Considerations

Examples

The following example creates an event and waits for the event to be completed.

#include <tpfapi.h>
struct ev0bk           event_blk;
enum t_evn_typ         event_type;
char                   caller_provided_name;
int                    event_timeout;
enum t_state           event_state;
 

  ·
  ·
  ·
evntc(&event_blk, event_type, caller_provided_name, event_timeout event_state); tpf_sawnc(&event_blk, event_type);
  ·
  ·
  ·

Related Information