void TimerSleep(
word ticks); /* number of ticks the thread should sleep */
This routine invokes a "sleep timer" that will put the calling thread to sleep for the given number of ticks. At the end of the time, the thread will continue executing with the next instruction.
Warnings: Do not use sleep timers as a substitute for semaphores for thread synchronization.
Include: timer.h
TimerHandle TimerStart(
TimerType timerType, /* type of timer to start */
optr destObject, /* object to receive notification
* message when timer expires */
word ticks, /* amount of time to run */
Message msg, /* notification message */
word interval, /* interval for continual timers */
word * id); /* buffer for returned timer ID */
This routine starts a timer of any type. The timer will run for the specified number of ticks and then will send the given message to the destination object. The message is sent with the flags MF_FORCE_QUEUE, MF_CHECK_DUPLICATE and MF_REPLACE, so it will always be put in the recipient's queue and will always replace any duplicates already in the queue. Pass this routine the following:
timerType
TimerType
indicating the type of timer to start.
destObject
ticks
msg
interval
ticks
ticks after the timer is started. The second message will be sent
interval
ticks after that.
id
TimerStop()
.
This routine returns the handle of the timer as well as an ID pointed to by the
id
parameter. You will need the handle and the ID for
TimerStop()
.
Structures:
TimerType
The
TimerType
enumerated type defines what type of timer should be initiated. It has the following values:
TimerStop()
is called.
TimerStop()
is called.Include: timer.h
Boolean TimerStop(
TimerHandle th, /* handle of timer to be stopped */
word id); /* timer ID (returned by TimerStart() */
This routine stops and destroys a timer that had been started with
TimerStart()
. Pass it the timer handle and the ID as returned by that routine (the ID of a continual timer will always be zero).
The returned error flag will be
true
if the timer could not be found.
Warnings: If you call
TimerStop()
to stop a continual timer that sends its message across threads, there may be timer events left in the recipient's event queue. It is unsafe in this situation to assume that all timer events have been handled. To ensure the timer message has been handled, you can send the destination an "all-safe" message with the MF_FORCE_QUEUE flag.
Include: timer.h
void * TocDBLock(
DBGroupAndItem thing);
Use this routine to lock a name array maintained by a PrefTocList object.
Include: config.goh
void * TocDBLockGetRef(
DBGroupAndItem thing,
optr *refPtr);
This routine locks a name array maintained by a PrefTocList object, returning the item's pointer and optr.
Include: config.goh
Boolean TocFindCategory(
TocCategoryStruct *cat);
This routine searches a PrefTocList object's name lists for a given token.
Structures:
typedef struct {
TokenChars TCS_tokenChars;
DBGroupAndItem TCS_files; /* file name array */
DBGroupAndItem TCS_devices; /* device name array--only if
* TCF_EXTENDED_DEVICE_DRIVERS
* is set. */
} TocCategoryStruct;
Include: config.goh
word TocGetFileHandle();
Use this routine to get the handle of the file used by PrefTocLists to store their name array data.
Include: config.goh
word TocNameArrayAdd(
DBGroupAndItem array,
const char *nameToFind,
const void *data);
Use this routine to add a name to a name array maintained by a PrefTocList object.
Include: config.h
GEOS SDK TechDocs
|
|
ThreadPSem() ...
|
TocNameArrayFind() ...