blob: 6d0b2ad21513197828b274ee565e0e97e3c7e5d9 (
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
32
33
34
35
36
37
38
|
#ifndef __MAILCORE_MCAUTORELEASEPOOL_H_
#define __MAILCORE_MCAUTORELEASEPOOL_H_
#include <MailCore/MCObject.h>
#include <libetpan/libetpan.h>
#include <pthread.h>
#ifdef __cplusplus
namespace mailcore {
class AutoreleasePool : public Object {
public:
AutoreleasePool();
virtual ~AutoreleasePool();
static void autorelease(Object * obj);
public: // subclass behavior
virtual String * description();
private:
static void init();
static pthread_key_t autoreleasePoolStackKey;
carray * mPoolObjects;
static carray * createAutoreleasePoolStackIfNeeded();
static void destroyAutoreleasePoolStack(void *);
static void initAutoreleasePoolStackKey();
static AutoreleasePool * currentAutoreleasePool();
virtual void add(Object * obj);
};
}
#endif
#endif
|