Example #1
0
static void
no_lazy_lock(void)
{
	thd_t thd;

	thd_create(&thd, thd_start, NULL);
	thd_join(thd, NULL);
}
Example #2
0
TEST_END

TEST_BEGIN(test_subthread)
{
	thd_t thd;

	thd_create(&thd, thd_start, NULL);
	thd_join(thd, NULL);
}
Example #3
0
TEST_END

TEST_BEGIN(test_tsd_sub_thread)
{
    thd_t thd;

    data_cleanup_executed = false;
    thd_create(&thd, thd_start, (void *)THREAD_DATA);
    thd_join(thd, NULL);
    assert_true(data_cleanup_executed,
                "Cleanup function should have executed");
}
Example #4
0
void sndoggvorbis_shutdown() {
	if (!thd) {
		printf("sndserver: not initialized!\n");
		return;
	}

	sndoggvorbis_thd_quit();
	thd_join(thd, NULL);
	thd = NULL;

	printf("sndserver: exited successfully\n");
}
Example #5
0
int aica_audio_close() {
	
	aud_set = sndptr = 0;
    thd_join(loop_thread, NULL);
    snd_stream_stop(shnd);
    snd_stream_destroy(shnd);
	
	if(tmpbuf)
		free(tmpbuf);
		
	if(sndbuf)
		free(sndbuf);
	
	return 0;
}
Example #6
0
TEST_END

TEST_BEGIN(test_tsd_sub_thread) {
	thd_t thd;

	data_cleanup_count = 0;
	thd_create(&thd, thd_start, (void *)MALLOC_TSD_TEST_DATA_INIT);
	thd_join(thd, NULL);
	/*
	 * We reincarnate twice in the data cleanup, so it should execute at
	 * least 3 times.
	 */
	assert_x_ge(data_cleanup_count, 3,
	    "Cleanup function should have executed multiple times.");
}
Example #7
0
static void stop_audio() {
	aud_set = 0;
    thd_join(loop_thread, NULL);
    snd_stream_stop(shnd);
}