[so] [tema4]variabile conditie
Andrei Deftu
andreideftu at yahoo.com
Thu Aug 28 00:18:49 EEST 2008
--- On Wed, 8/27/08, Diana-Elena Gratie <diana_gratie at yahoo.com> wrote:
> Sal!
> Nu inteleg cum ar trebui sa folosim variabilele conditie.
> Eu m-am gandit la un vector de variabile conditie, tinut in
> structura monitor. Dar ca parametru in wait eu primesc un
> int. Am cautat definirea tipului pthread_cond_t, dar nu am
> reusit sa gasesc. Am gasit in schimb asta:
> All of the types are defined as arithmetic types of an
> appropriate length,
> with the following exceptions: key_t, pthread_attr_t,
> pthread_cond_t, pthread_condattr_t, pthread_key_t,
> pthread_mutex_t, pthread_mutexattr_t, pthread_once_t,
> pthread_rwlock_t and pthread_rwlockattr_t.
> Din asta inteleg ca pthread_cond_t nu prea e un tip
> aritmetic, ca sa zic ca pot folosi int...
> Ma poate lamuri cineva, pls?
> Mersi.
> Diana
Buna
Nu am inteles ce vrei. Parametrul pe care-l primesti reprezinta numarul conditiei la care vrei sa astepti, deci il poti folosi pentru indexare in vectorul de variabile de conditii.
Daca vrei sa stii si ce este pthread_cond_t:
http://www.comp.ufscar.br/lxr/source/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h?v=glibc-2.7#L99
More information about the so
mailing list