trick/include/trick/release.h
Alex Lin 8f76605f3b Create Message client that writes to screen on a separate thread #553
Created a new message class that will copy incoming messages to a
buffer area.  The buffer area is pre allocated during simulation
initialization.  On a separate thread the buffer area is written
to std::cout.
2018-01-25 15:59:19 -06:00

37 lines
914 B
C

/*
PURPOSE:
(This header file defines the "RELEASE()" macro for supported platforms.
The release function should yield the processor from the processes that makes the call. This allows the UNIX schedular to arbitrate process
priorities during spinloops based on the status of processes waiting
to run)
PROGRAMMER:
(((Eddie J. Paddock ) (LinCom) (2/96) (--) (Realtime))
((Scott Killingsworth ) (LinCom) (October 1997) (OSF1 port) (Issue #1233)))
*/
#ifndef RELEASE_H
#define RELEASE_H
#if __sgi
#define RELEASE() sginap(0)
#define RELEASE_1() sginap(1)
#elif __vxworks
#define RELEASE() taskDelay(1)
#define RELEASE_1() taskDelay(1)
#else
#include <time.h>
#define RELEASE() { struct timespec timeout;\
timeout.tv_sec = 0;\
timeout.tv_nsec = 0;\
nanosleep(&timeout, NULL);}
#define RELEASE_1() RELEASE()
#endif
#endif