Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 7cb6333e rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Reduce number of comments

parent c4837981
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!67Resolve "Thread pool"
...@@ -45,65 +45,31 @@ typedef struct mthread_sem_s mthread_sem_t; ...@@ -45,65 +45,31 @@ typedef struct mthread_sem_s mthread_sem_t;
/* Function for handling threads. */ /* Function for handling threads. */
/* Create a thread with given attributes ATTR (or default attributes
if ATTR is NULL), and call function START_ROUTINE with given
arguments ARG. */
int mthread_create(mthread_t *__threadp, const mthread_attr_t *__attr, void *(*__start_routine) (void *), int mthread_create(mthread_t *__threadp, const mthread_attr_t *__attr, void *(*__start_routine) (void *),
void *__arg); void *__arg);
/* Obtain the identifier of the current thread. */
mthread_t mthread_self(void); mthread_t mthread_self(void);
/* Compare two thread identifiers. */
int mthread_equal(mthread_t __thread1, mthread_t __thread2); int mthread_equal(mthread_t __thread1, mthread_t __thread2);
/* Terminate calling thread. */
void mthread_exit(void *__retval); void mthread_exit(void *__retval);
/* Make calling thread wait for termination of the thread TH. The
exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
is not NULL. */
int mthread_join(mthread_t __th, void **__thread_return); int mthread_join(mthread_t __th, void **__thread_return);
/* Functions for mutex handling. */ /* Functions for mutex handling. */
/* Initialize MUTEX using attributes in *MUTEX_ATTR, or use the
default values if later is NULL. */
int mthread_mutex_init (mthread_mutex_t *__mutex, int mthread_mutex_init (mthread_mutex_t *__mutex,
const mthread_mutexattr_t *__mutex_attr); const mthread_mutexattr_t *__mutex_attr);
/* Destroy MUTEX. */
int mthread_mutex_destroy(mthread_mutex_t *__mutex); int mthread_mutex_destroy(mthread_mutex_t *__mutex);
/* Try to lock MUTEX. */
int mthread_mutex_trylock(mthread_mutex_t *__mutex); int mthread_mutex_trylock(mthread_mutex_t *__mutex);
/* Wait until lock for MUTEX becomes available and lock it. */
int mthread_mutex_lock(mthread_mutex_t *__mutex); int mthread_mutex_lock(mthread_mutex_t *__mutex);
/* Unlock MUTEX. */
int mthread_mutex_unlock(mthread_mutex_t *__mutex); int mthread_mutex_unlock(mthread_mutex_t *__mutex);
/* Functions for handling conditional variables. */ /* Functions for handling conditional variables. */
/* Initialize condition variable COND using attributes ATTR, or use
the default values if later is NULL. */
int mthread_cond_init(mthread_cond_t *__cond, int mthread_cond_init(mthread_cond_t *__cond,
const mthread_condattr_t *__cond_attr); const mthread_condattr_t *__cond_attr);
/* Destroy condition variable COND. */
int mthread_cond_destroy(mthread_cond_t *__cond); int mthread_cond_destroy(mthread_cond_t *__cond);
/* Wake up one thread waiting for condition variable COND. */
int mthread_cond_signal(mthread_cond_t *__cond); int mthread_cond_signal(mthread_cond_t *__cond);
/* Wake up all threads waiting for condition variables COND. */
int mthread_cond_broadcast(mthread_cond_t *__cond); int mthread_cond_broadcast(mthread_cond_t *__cond);
int mthread_cond_wait(mthread_cond_t *__cond, mthread_mutex_t *__mutex);
/* Wait for condition variable COND to be signaled or broadcast.
MUTEX is assumed to be locked before. */
int mthread_cond_wait (mthread_cond_t *__cond,
mthread_mutex_t *__mutex);
/* Functions for handling thread-specific data. */ /* Functions for handling thread-specific data. */
...@@ -113,8 +79,7 @@ int mthread_cond_wait (mthread_cond_t *__cond, ...@@ -113,8 +79,7 @@ int mthread_cond_wait (mthread_cond_t *__cond,
associated to that key when the key is destroyed. associated to that key when the key is destroyed.
DESTR_FUNCTION is not called if the value associated is NULL when DESTR_FUNCTION is not called if the value associated is NULL when
the key is destroyed. */ the key is destroyed. */
int mthread_key_create (mthread_key_t *__key, int mthread_key_create(mthread_key_t *__key, void (*__destr_function) (void *));
void (*__destr_function) (void *));
/* Destroy KEY. */ /* Destroy KEY. */
int mthread_key_delete(mthread_key_t __key); int mthread_key_delete(mthread_key_t __key);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter