Multi Treading
Imagine has full thread supprot that lets you create threads and thread safe Mutex locks.
imagine_mutex_create
void *imagine_mutex_create();
Description: Creates a Mutex. Mutex locks are unlocked when created.imagine_mutex_lock
void imagine_mutex_lock(void *mutex);
Description: Lock a mutex. If the lock is already locked, the thread will wait on the lock until the lock is unlocked so that it can lock itimagine_mutex_lock_try
boolean imagine_mutex_lock_try(void *mutex);
Description: The thread will atempt to lock the thread, if the lock is already locked if will returne FALSE and fail, If is is not locked, it will lock the mutex and return TRUEimagine_mutex_unlock
void imagine_mutex_unlock(void *mutex);
Description: Un locks the Muteximagine_mutex_destroy
void imagine_mutex_destroy(void *mutex);
Description: Destroys the muteximagine_signal_create
void *imagine_signal_create();
Description: Creates a signal bockerimagine_signal_destroy
void imagine_signal_destroy(void *signal);
Description: Destroys a signal blockerimagine_signal_wait
boolean imagine_signal_wait(void *signal, void *mutex);
Description: Sets a thread to wait on the blocker for another thread to a activate it.imagine_signal_activate
boolean imagine_signal_activate(void *signal);
Description: Activates the blocker so that one or more threads waiting on the signal will be releasedimagine_thread
void imagine_thread(void (*func)(void *data), void *data);
Description: launches a thread that will execute the function pointer. The void pointer will be given as i parameter. Onec the function returns the thread will be deleted.imagine_mutex_create_debug
void *imagine_mutex_create_debug();
Description: debug version of magine_mutex_createimagine_signal_destroy_debug
void imagine_signal_destroy_debug(void *mutex, char *file, uint line);
Description: debug version of magine_mutex_destroyimagine_mutex_lock_debug
void imagine_mutex_lock_debug(void *mutex, char *file, uint line);
Description: debug version of imagine_mutex_lockimagine_mutex_lock_try_debug
boolean imagine_mutex_lock_try_debug(void *mutex, char *file, uint line);
Description: debug version of imagine_mutex_lock_tryimagine_mutex_unlock_debug
void imagine_mutex_unlock_debug(void *mutex, char *file, uint line);
Description: debug version of imagine_mutex_unlockimagine_signal_wait_debug
void imagine_signal_wait_debug(void *signal, void *mutex, char *file, uint line);
Description: debug version of imagine_mutex_unlockimagine_mutex_is_locked_debug
boolean imagine_mutex_is_locked_debug(void *mutex);
Description: check if a lock is lockedimagine_mutex_print_debug
void imagine_mutex_print_debug();
Description: prints out all currently locked mutexes and where they have been locked.