11.2.   -  ... 387

,      "" . 
         POSIX-,
Pthread-  Pthread- .

   ,  , 
 ""     . 
   ,    ""   
.   synchronization_variable   11.7.

//  11.7.   synchronization_variable

class synchronization_variable{
protected:

runtime_error Exception;

//. . .
public:

int virtual lock(void) = 0;

int virtual unlock(void) = 0;

int virtual trylock(void) = 0;

// . . .
};

   ,     synchroniza-
tion_variable      0. 
,      ,   
synchronization_variable .  ,    
   ,     . 
  ,          
   .         -
 ,        . 
     .    ,
   ,   ,     -
   ,         -
.           -
.  ,       -
.          .
  ,       [9].
 synchronization_variable     -
  .     -
    . Pthread-   -
   ,     mutex  -
   synchronization_variable.

//  11.8.   , 
//                 synchronization_variable

class mutex : public synchronization_variable{
protected:

pthread_mutex_t *Mutex;

pthread_mutexattr_t *MutexAttr;

//. . .
public:

int lock(void);