Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions synchronization/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@

source_set("synchronization") {
sources = [
"debug_thread_checker.h",
"pipeline.cc",
"pipeline.h",
"semaphore.cc",
"semaphore.h",
]

public_configs = [
"$flutter_root:config",
]
public_configs = [ "$flutter_root:config" ]

public_deps = [
"$flutter_root/glue",
Expand Down
25 changes: 0 additions & 25 deletions synchronization/debug_thread_checker.h

This file was deleted.

6 changes: 5 additions & 1 deletion synchronization/semaphore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ namespace flutter {
class PlatformSemaphore {
public:
explicit PlatformSemaphore(uint32_t count)
: _sem(dispatch_semaphore_create(count)) {}
: _sem(dispatch_semaphore_create(count)), _initial(count) {}

~PlatformSemaphore() {
for (uint32_t i = 0; i < _initial; ++i) {
Signal();
}
if (_sem != nullptr) {
dispatch_release(reinterpret_cast<dispatch_object_t>(_sem));
_sem = nullptr;
Expand All @@ -42,6 +45,7 @@ class PlatformSemaphore {

private:
dispatch_semaphore_t _sem;
const uint32_t _initial;

FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore);
};
Expand Down