@@ -29,7 +29,7 @@ namespace photon {
2929class WorkPool {
3030public:
3131 /* *
32- * @brief Construct a new Work Pool object
32+ * @brief Construct a new Work Pool object; available in non-photon environment
3333 *
3434 * @param vcpu_num how many VCPU (std threads) create for this workpool
3535 * @param ev_engine how to initial event engine as preset VCPUs
@@ -44,21 +44,22 @@ class WorkPool {
4444 WorkPool (const WorkPool& other) = delete ;
4545 WorkPool& operator =(const WorkPool& rhs) = delete ;
4646
47+ // available in non-photon environment
4748 ~WorkPool ();
4849
4950 /* *
5051 * @brief `hold_as_worker` makes blocks current std thread join workpool, as
51- * a woker member. Noticed that worker should initial environment by self ,
52+ * a woker member. Note that workers should initialize photon environment by themselves ,
5253 * workpool will not do photon environment for it. When workpool destructed,
5354 * the function call will be finished, and return 0.
5455 * @return int 0 for success, and -1 for failure
5556 */
5657 int join_current_vcpu_into_workpool ();
5758
5859 /* *
59- * @brief Get the vcpu num
60- *
61- * @return int
60+ * @brief Get the vcpu num; available in non-photon environment
61+ *
62+ * @return int
6263 */
6364 int get_vcpu_num ();
6465
@@ -83,6 +84,7 @@ class WorkPool {
8384
8485 /* *
8586 * @brief `async_call` just like `call`, but do not wait for task done.
87+ * available in non-photon environment.
8688 *
8789 * @param task Pointer to async task callable object. Call by lamda could
8890 * using `workpool.async_call(new auto ([&](){ // some lambda; }));` The
@@ -103,9 +105,7 @@ class WorkPool {
103105 * [0, vcpu_num), it will choose the next one in pool (round-robin).
104106 * @return int 0 for success, and <0 means failed to migrate.
105107 */
106- int thread_migrate (photon::thread* th = CURRENT , size_t index = -1UL ) {
107- return photon::thread_migrate (th, get_vcpu_in_pool (index));
108- }
108+ int thread_migrate (photon::thread* th = CURRENT , size_t index = -1UL );
109109
110110protected:
111111 class impl ; // does not depend on T
@@ -115,7 +115,6 @@ class WorkPool {
115115 template <typename Context>
116116 void do_call (Delegate<void > call);
117117 void enqueue (Delegate<void > call);
118- photon::vcpu_base* get_vcpu_in_pool (size_t index);
119118
120119 template <typename Task>
121120 static void __async_call_helper (void * task) {
0 commit comments