Ejemplo n.º 1
0
int initializePlatform(void) {
    int err;

    err = initializePlatformSockets();
    if (err != 0) {
        return err;
    }

    return PltCreateMutex(&thread_list_lock);
}
Ejemplo n.º 2
0
/* Linked blocking queue init */
int LbqInitializeLinkedBlockingQueue(PLINKED_BLOCKING_QUEUE queueHead, int sizeBound) {
	int err;
	
	err = PltCreateEvent(&queueHead->containsDataEvent);
	if (err != 0) {
		return err;
	}

	err = PltCreateMutex(&queueHead->mutex);
	if (err != 0) {
		return err;
	}

	queueHead->head = NULL;
	queueHead->tail = NULL;
	queueHead->sizeBound = sizeBound;
	queueHead->currentSize = 0;

	return 0;
}