proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
GILAwareManualExecutor.h
Go to the documentation of this file.
1
/*
2
* Copyright 2018-present Facebook, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#include <condition_variable>
20
#include <memory>
21
#include <mutex>
22
#include <queue>
23
24
#include <
folly/executors/DrivableExecutor.h
>
25
#include <
folly/executors/SequencedExecutor.h
>
26
27
namespace
folly
{
28
namespace
python {
29
34
class
GILAwareManualExecutor
:
public
DrivableExecutor
,
35
public
SequencedExecutor
{
36
public
:
37
void
add
(
Func
)
override
;
38
39
void
drive
()
override
{
40
waitBeforeDrive
();
41
driveImpl
();
42
}
43
44
private
:
45
void
waitBeforeDrive
();
46
void
driveImpl
();
47
48
std::mutex
lock_
;
49
std::queue<Func>
funcs_
;
50
std::condition_variable
cv_
;
51
};
52
53
}
// namespace python
54
}
// namespace folly
folly::python::GILAwareManualExecutor::waitBeforeDrive
void waitBeforeDrive()
Definition:
GILAwareManualExecutor.cpp:34
DrivableExecutor.h
folly::python::GILAwareManualExecutor
Definition:
GILAwareManualExecutor.h:34
folly::python::GILAwareManualExecutor::add
void add(Func) override
Definition:
GILAwareManualExecutor.cpp:26
folly::python::GILAwareManualExecutor::driveImpl
void driveImpl()
Definition:
GILAwareManualExecutor.cpp:51
folly
—— Concurrent Priority Queue Implementation ——
Definition:
AtomicBitSet.h:29
folly::python::GILAwareManualExecutor::lock_
std::mutex lock_
Definition:
GILAwareManualExecutor.h:48
folly::python::GILAwareManualExecutor::cv_
std::condition_variable cv_
Definition:
GILAwareManualExecutor.h:50
SequencedExecutor.h
folly::python::GILAwareManualExecutor::drive
void drive() override
Definition:
GILAwareManualExecutor.h:39
folly::python::GILAwareManualExecutor::funcs_
std::queue< Func > funcs_
Definition:
GILAwareManualExecutor.h:49
folly::SequencedExecutor
Definition:
SequencedExecutor.h:27
folly::Function< void()>
mutex
std::mutex mutex
Definition:
StaticSingletonManager.cpp:39
folly::DrivableExecutor
Definition:
DrivableExecutor.h:40
proxygen
folly
folly
python
GILAwareManualExecutor.h
Generated by
1.8.11