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

Side by Side Diff: xfa/include/fwl/core/fwl_thread.h

Issue 1502063005: Re-land "Rename CFWL_Thread classes to ThreadImp" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: unformat comment Created 5 years 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
« no previous file with comments | « xfa/include/fwl/core/fwl_app.h ('k') | xfa/include/fwl/lightwidget/app.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef _FWL_THREAD_H 7 #ifndef FWL_THREAD_H_
8 #define _FWL_THREAD_H 8 #define FWL_THREAD_H_
9
10 // The FWL thread/app code contains three parallel inheritance hierarchies,
11 // which reference each other via pointers as follows:
12 //
13 // m_pImpl
14 // (nonesuch) IFWL_Thread ----------> CFWL_ThreadImp
15 // | <---------- |
16 // A m_pIface A
17 // | |
18 // (nonesuch) IFWL_NoteThread CFWL_NoteThreadImp
19 // | |
20 // A A
21 // m_pIface | |
22 // CFWL_App --------------> IFWL_App CFWL_AppImp
23 //
24
25 class CFWL_ThreadImp;
9 class IFWL_NoteDriver; 26 class IFWL_NoteDriver;
10 class IFWL_Thread; 27
11 class IFWL_NoteThread;
12 typedef struct _FWL_HTHREAD { void* pData; } * FWL_HTHREAD; 28 typedef struct _FWL_HTHREAD { void* pData; } * FWL_HTHREAD;
29
13 class IFWL_Thread { 30 class IFWL_Thread {
14 public: 31 public:
15 static IFWL_Thread* Create(); 32 // These call into polymorphic methods in the impl; no need to override.
33 void Release();
34 FWL_ERR Run(FWL_HTHREAD hThread);
35
36 CFWL_ThreadImp* GetImpl() const { return m_pImpl; }
37 void SetImpl(CFWL_ThreadImp* pImpl) { m_pImpl = pImpl; }
16 38
17 protected: 39 protected:
18 virtual ~IFWL_Thread() {} 40 virtual ~IFWL_Thread() {}
19 41
20 public: 42 private:
21 virtual void Release() = 0; 43 CFWL_ThreadImp* m_pImpl;
22 virtual FWL_ERR Run(FWL_HTHREAD hThread) = 0;
23 }; 44 };
24 FWL_HTHREAD FWL_StartThread(IFWL_Thread* pThread, FX_BOOL bSuspended = FALSE); 45
25 FWL_ERR FWL_ResumeThread(FWL_HTHREAD hThread);
26 FWL_ERR FWL_SuspendThread(FWL_HTHREAD hThread);
27 FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, int32_t iExitCode);
28 FWL_ERR FWL_StopThread(FWL_HTHREAD hThread, int32_t iExitCode);
29 FWL_ERR FWL_Sleep(FX_DWORD dwMilliseconds);
30 class IFWL_NoteThread : public IFWL_Thread { 46 class IFWL_NoteThread : public IFWL_Thread {
31 public: 47 public:
32 static IFWL_NoteThread* Create(); 48 IFWL_NoteDriver* GetNoteDriver();
33 virtual FWL_ERR Run(FWL_HTHREAD hThread) = 0;
34 virtual IFWL_NoteDriver* GetNoteDriver() = 0;
35 }; 49 };
36 typedef struct _FWL_HMUTEX { void* pData; } * FWL_HMUTEX; 50
37 FWL_HMUTEX FWL_CreateMutex(); 51 #endif // FWL_THREAD_H_
38 FWL_ERR FWL_DestroyMutex(FWL_HMUTEX hMutex);
39 FWL_ERR FWL_LockMutex(FWL_HMUTEX hMutex);
40 FWL_ERR FWL_TryLockMutex(FWL_HMUTEX hMutex);
41 FWL_ERR FWL_UnlockMutex(FWL_HMUTEX hMutex);
42 FWL_ERR FWL_IsLockedMutex(FWL_HMUTEX hMutex, FX_BOOL& bLocked);
43 typedef struct _FWL_HSEMAPHORE { void* pData; } * FWL_HSEMAPHORE;
44 FWL_HSEMAPHORE FWL_CreateSemaphore();
45 FWL_ERR FWL_DestroySemaphore(FWL_HSEMAPHORE hSemaphore);
46 FWL_ERR FWL_WaitSemaphore(FWL_HSEMAPHORE hSemaphore);
47 FWL_ERR FWL_PostSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t down = 1);
48 FWL_ERR FWL_GetSemaphoreValue(FWL_HSEMAPHORE hSemaphore, int32_t& value);
49 FWL_ERR FWL_ResetSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t init);
50 #endif
OLDNEW
« no previous file with comments | « xfa/include/fwl/core/fwl_app.h ('k') | xfa/include/fwl/lightwidget/app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698