wiki:pthread_spin_destroy

Version 4 (modified by Ghassan Almaless, 17 years ago) (diff)

--

Nom

pthread_spin_destroy- détruit un verrou à une attente active (objet de synchronisation temps-réal).

Synopsis

#include <pthread.h>
int pthread_spin_destroy(pthread_spinlock_t *lock);

Description

pthread_spin_destroy() devra détruire le verrou référencé par lock.

Le résultat d'une réutilisation de ce verrou après l'avoir détruit par cette fonction est indéfini jusqu'au une nouvelle initialisation par la fonction pthread_spin_init.

Le résultat est indéfini si pthread_spin_destroy() est appelé or il existe un thread détient le le verrou lock ou encore lors que le verrou lock n'a pas été initialisé auparavant.

Dans la version actuelle du MUTEKP, la gestion mémoire est minimaliste, par conséquence, aucune libération de mémoire allouée par cet objet est effectué lors de l'exécution de cette fonction.

Valeur Renvoyée

En cas de succès, pthread_spin_destroy() renvoie la valeur 0. En cas d'erreur, un code d'erreur est renvoyé.

Erreurs

La fonction pthread_spin_destroy() renvoie l'un des codes d'erreur suivants en cas de problème:

EINVAL
la valeur de l'argument lock est nulle
EINVAL
L'implémentation a détecté que le verrou lock n'a pas été initialisé auparavant.
EBUSY
L'implémentation a détécté que le verrou lock est au cours de l'utilisation par un thread.

Source

Copyright
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Traduction et Adaptation MUTEKP

Ghassan Almaless <Ghassan.Almalass@…>, <ghassan.almaless@…>, 2007

Voir Aussi

pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock.