AsyncTasksManager.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include <Bentley/Tasks/Tasks.h>
12 #include <Bentley/BeThread.h>
13 #include <Bentley/bmap.h>
14 #include <condition_variable>
15 #include <mutex>
16 
18 
19 struct AsyncTask;
20 struct WorkerThreadPool;
21 struct ITaskScheduler;
22 
23 /*--------------------------------------------------------------------------------------+
24 * @bsiclass Bentley Systems
25 +---------------+---------------+---------------+---------------+---------------+------*/
27  {
28  private:
30 
31  public:
32  BENTLEYDLL_EXPORT static std::shared_ptr<ITaskRunner> GetTaskRunner (intptr_t threadId);
33 
34  BENTLEYDLL_EXPORT static std::shared_ptr<ITaskRunner> GetCurrentTaskRunner ();
35  BENTLEYDLL_EXPORT static std::shared_ptr<AsyncTask> GetCurrentThreadAsyncTask ();
36 
40  BENTLEYDLL_EXPORT static std::shared_ptr<ITaskScheduler> GetDefaultScheduler ();
41 
45  BENTLEYDLL_EXPORT static void StopThreadingAndWait();
46 
49  BENTLEYDLL_EXPORT static void SetWaitForThreadsWhenStopped(bool value);
50  };
51 
#define BENTLEYDLL_EXPORT
Definition: Bentley.h:249
Together with the BeCriticalSection.h file provides Bentley specific thread handling functions (Bentl...
Definition: AsyncTasksManager.h:26
#define BEGIN_BENTLEY_TASKS_NAMESPACE
Definition: Tasks.h:13
#define END_BENTLEY_TASKS_NAMESPACE
Definition: Tasks.h:14

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.