Beispiel #1
0
 void Thread::stop()
 {
     if (!m_alive)
         return;
     Thread_destroy(m_handle);
     m_alive=false;
 }
Beispiel #2
0
void *IoThread_BeginThread(void *vti)
{
	IoThreadInfo *ti = (IoThreadInfo *)vti;
	Thread *t = IoThreadInfo_thread(ti);
	IoState *state = IoThreadInfo_state(ti);

	Thread_setUserData_(t, state);
	IoState_doCString_(state, IoThreadInfo_evalString(ti));
	IoThreadInfo_free(ti);
	IoState_free(state);
	Thread_destroy(t);
	return NULL;
}
Beispiel #3
0
void
IsoServer_stopListening(IsoServer self)
{
    stopListening(self);

    if (self->serverThread != NULL)
        Thread_destroy(self->serverThread);

    closeAllOpenClientConnections(self);

    /* Wait for connection threads to finish */
    while (private_IsoServer_getConnectionCounter(self) > 0)
        Thread_sleep(10);

    if (DEBUG_ISO_SERVER)
        printf("ISO_SERVER: IsoServer_stopListening finished!\n");
}
void
IsoClientConnection_destroy(IsoClientConnection self)
{
	if (self->state == STATE_ASSOCIATED)
		IsoClientConnection_close(self);

	if (self->thread != NULL)
		Thread_destroy(self->thread);

	if (self->cotpBuf != NULL) free(self->cotpBuf);
	if (self->cotpBuffer != NULL) free(self->cotpBuffer);
	if (self->cotpConnection != NULL) {
		CotpConnection_destroy(self->cotpConnection);
		free(self->cotpConnection);
	}
	if (self->session != NULL) free(self->session);
	if (self->presentation != NULL) free(self->presentation);

	free(self->buffer1);
	free(self->buffer2);
	free(self);
}
Beispiel #5
0
IoObject *IoThread_endCurrentThread(IoObject *self, IoObject *locals, IoMessage *m)
{
	// shutdown vm?
	Thread_destroy(Thread_CurrentThread());
	return self;
}