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 bockermagine_signal_destroy
void *magine_signal_destroy(void *signal);
Description: Destroys a signal blockerimagine_signal_wait
boolean imagine_signal_wait(void *signal);
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.