~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_toolkit/ADM_threads.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-12-15 17:13:20 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061215171320-w79pvpehxx2fr217
Tags: 1:2.3.0-0.0ubuntu1
* Merge from debian-multimedia.org, remaining Ubuntu change:
  - desktop file,
  - no support for ccache and make -j.
* Closes Ubuntu: #69614.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                    
 
3
    copyright            : (C) 2006 by mean
 
4
    email                : fixounet@free.fr
 
5
 ***************************************************************************/
 
6
 
 
7
/***************************************************************************
 
8
 *                                                                         *
 
9
 *   This program is free software; you can redistribute it and/or modify  *
 
10
 *   it under the terms of the GNU General Public License as published by  *
 
11
 *   the Free Software Foundation; either version 2 of the License, or     *
 
12
 *   (at your option) any later version.                                   *
 
13
 *                                                                         *
 
14
 ***************************************************************************/
 
15
 
 
16
 
 
17
#ifndef ADM_THREADS_H
 
18
#define ADM_THREADS_H
 
19
 
 
20
#include <pthread.h>
 
21
 
 
22
class admMutex
 
23
{
 
24
  private:
 
25
    uint8_t       _locked;
 
26
    const char    *_name;
 
27
  public: 
 
28
    pthread_mutex_t _tex;       
 
29
    admMutex( const char *name=NULL);
 
30
    ~admMutex();        
 
31
    uint8_t lock(void);
 
32
    uint8_t unlock(void);
 
33
    uint8_t isLocked(void);
 
34
};
 
35
 
 
36
class admCond
 
37
{
 
38
  private:
 
39
    pthread_cond_t  _cond;
 
40
    admMutex        *_condtex;
 
41
 
 
42
  public:        
 
43
    uint8_t         waiting;
 
44
    uint8_t         aborted;
 
45
    admCond( admMutex *tex);
 
46
    ~admCond();        
 
47
    uint8_t wait(void);
 
48
    uint8_t wakeup(void);
 
49
    uint8_t iswaiting(void);
 
50
    uint8_t abort(void);
 
51
                
 
52
};
 
53
extern admMutex sharedMutex;
 
54
#endif