PageRenderTime 126ms CodeModel.GetById 121ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/platform/osx/thread.d

http://github.com/wilkie/djehuty
D | 88 lines | 66 code | 21 blank | 1 comment | 4 complexity | 208d0483bc651d5f9149ad068a27495b MD5 | raw file
 1module platform.osx.thread;
 2
 3class Thread
 4{
 5
 6public:
 7
 8	~this()
 9	{
10		Stop();
11	}
12
13	// the common function for the thread
14	void Call()
15	{
16		if (_thread_callback !is null)
17		{
18			_thread_callback();
19		}
20		else if (_thread_f_callback !is null)
21		{
22			_thread_f_callback();
23		}
24	}
25
26	void SetDelegate(void delegate() callback)
27	{
28		_thread_callback = callback;
29		_thread_f_callback = null;
30	}
31
32	void SetDelegate(void function() callback)
33	{
34		_thread_f_callback = callback;
35		_thread_callback = null;
36	}
37
38	bool IsCurrentThread()
39	{
40	}
41
42	void Sleep(long milliseconds)
43	{
44	}
45
46	void Start()
47	{
48	}
49
50	void Stop()
51	{
52	}
53
54protected:
55
56	void delegate () _thread_callback = null;
57	void function () _thread_f_callback = null;
58
59}
60
61
62class Semaphore
63{
64public:
65
66	~this()
67	{
68		if (_inited)
69		{
70			CloseHandle(_semaphore);
71		}
72	}
73
74	void Init(uint initialValue)
75	{
76	}
77
78	void Up()
79	{
80	}
81
82	void Down()
83	{
84	}
85
86protected:
87
88}