KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
general_pthread_test.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <assert.h>
#include <dc/video.h>
#include <dc/maple/controller.h>

Functions

void * filler_thd (void *v)
 
void * mut_thd (void *v)
 
void * cv_thd (void *v)
 
void * rd_thd (void *v)
 
void * wr_thd (void *v)
 
int main (int argc, char **argv)
 

Variables

pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER
 
pthread_cond_t cv = PTHREAD_COND_INITIALIZER
 
pthread_rwlock_t rw = PTHREAD_RWLOCK_INITIALIZER
 
volatile int cv_ready = 0
 
volatile int cv_cnt = 0
 
volatile int cv_quit = 0
 

Function Documentation

◆ cv_thd()

void * cv_thd ( void * v)

References cv, cv_cnt, cv_quit, cv_ready, mut, NULL, and printf.

Referenced by main().

◆ filler_thd()

void * filler_thd ( void * v)

References NULL, printf, vram_s, x, and y.

Referenced by main().

◆ main()

int main ( int argc,
char ** argv )

◆ mut_thd()

void * mut_thd ( void * v)

References mut, NULL, printf, and r.

Referenced by main().

◆ rd_thd()

void * rd_thd ( void * v)

References NULL, printf, r, and rw.

Referenced by main().

◆ wr_thd()

void * wr_thd ( void * v)

References NULL, printf, r, and rw.

Referenced by main().

Variable Documentation

◆ cv

pthread_cond_t cv = PTHREAD_COND_INITIALIZER

Referenced by cv_thd(), and main().

◆ cv_cnt

volatile int cv_cnt = 0

Referenced by cv_thd().

◆ cv_quit

volatile int cv_quit = 0

Referenced by cv_thd(), and main().

◆ cv_ready

volatile int cv_ready = 0

Referenced by cv_thd(), and main().

◆ mut

pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER

Referenced by cv_thd(), main(), and mut_thd().

◆ rw

pthread_rwlock_t rw = PTHREAD_RWLOCK_INITIALIZER

Referenced by rd_thd(), and wr_thd().