Thread class.
Thread class. A multithreaded process is composed of a main execution thread and of several secondary threads. Each secondary thread is represented by a GThread object. The amount of memory required for the stack of a secondary thread is defined when the GThread object is constructed. The execution thread is started when function create is called. The execution can be terminated at all times by destroying the GThread object or calling terminate.Several static member functions control the thread scheduler. Function yield relinquishes the processor to another thread. Function select (COTHREADS only) provides a thread-aware replacement for the well-known unix system call select.
Note --- Both the copy constructor and the copy operator are declared as private members. It is therefore not possible to make multiple copies of instances of this class, as implied by the class semantic.
~GThread()
int create(void (*entry)(void*), void *arg)
void terminate()
static int yield()
static void* current()
static int select(int, fd_set*, fd_set*, fd_set*, struct timeval*)
int
gthread_read(int fd, void *buffer, size_t len)
{
fd_set rdset;
FD_ZERO(&rdset);
FD_SET(fd, &rdset);
GThread::select(fd+1, &rdset, 0, 0, 0);
return read(fd, buffer, len);
}
static void set_scheduling_callback(void (*call)(int))
Alphabetic index HTML hierarchy of classes or Java