Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/Windows/Thread.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Windows/Thread.h
2
3 #ifndef __WINDOWS_THREAD_H
4 #define __WINDOWS_THREAD_H
5
6 #include "Defs.h"
7
8 extern "C"
9 {
10 #include "../../C/Threads.h"
11 }
12
13 namespace NWindows {
14
15 class CThread
16 {
17 ::CThread thread;
18 public:
19 CThread() { Thread_Construct(&thread); }
20 ~CThread() { Close(); }
21 bool IsCreated() { return Thread_WasCreated(&thread) != 0; }
22 WRes Close() { return Thread_Close(&thread); }
23 WRes Create(THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *) , LPVOID parameter)
24 { return Thread_Create(&thread, startAddress, parameter); }
25 WRes Wait() { return Thread_Wait(&thread); }
26
27 #ifdef _WIN32
28 operator HANDLE() { return thread.handle; }
29 void Attach(HANDLE handle) { thread.handle = handle; }
30 HANDLE Detach() { HANDLE h = thread.handle; thread.handle = NULL; return h; }
31 DWORD Resume() { return ::ResumeThread(thread.handle); }
32 DWORD Suspend() { return ::SuspendThread(thread.handle); }
33 bool Terminate(DWORD exitCode) { return BOOLToBool(::TerminateThread(thread.ha ndle, exitCode)); }
34 int GetPriority() { return ::GetThreadPriority(thread.handle); }
35 bool SetPriority(int priority) { return BOOLToBool(::SetThreadPriority(thread. handle, priority)); }
36 #endif
37 };
38
39 }
40
41 #endif
OLDNEW
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/Windows/System.cpp ('k') | third_party/lzma/v4_65/files/CPP/Windows/Time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698