blob: 9cd0fc2f7e1564c9cc7974cebf73ade35cbe2402 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2009, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#ifndef SIMPLETHREAD_H
#define SIMPLETHREAD_H
#include "mutex.h"
class U_EXPORT SimpleThread
{
public:
SimpleThread();
virtual ~SimpleThread();
int32_t start(void); // start the thread
UBool isRunning(); // return true if a started thread has exited.
virtual void run(void) = 0; // Override this to provide the code to run
// in the thread.
void *fImplementation;
public:
static void sleep(int32_t millis); // probably shouldn't go here but oh well.
static void errorFunc(); // Empty function, provides a single convenient place
// to break on errors.
};
#endif
|