Skip to content

Commit

Permalink
dont redefine shared mutex in std namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ikbuibui committed Jan 25, 2024
1 parent c3ed1ac commit bfa107b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion redGrapes/redGrapes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace redGrapes
SPDLOG_TRACE("create child space = {}", (void*) task_space.get());
current_task->children = task_space;

std::unique_lock<std::shared_mutex> wr_lock(current_task->space->active_child_spaces_mutex);
std::unique_lock<std::shared_timed_mutex> wr_lock(current_task->space->active_child_spaces_mutex);
current_task->space->active_child_spaces.push_back(task_space);
}

Expand Down
4 changes: 0 additions & 4 deletions redGrapes/scheduler/event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
# define REDGRAPES_EVENT_FOLLOWER_LIST_CHUNKSIZE 16
#endif

namespace std
{
using shared_mutex = shared_timed_mutex;
} // namespace std

namespace redGrapes
{
Expand Down
2 changes: 1 addition & 1 deletion redGrapes/sync/spinlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace redGrapes
alignas(64) std::atomic<unsigned> reader_count;
alignas(64) std::atomic<bool> write;
#else
std::shared_mutex m;
std::shared_timed_mutex m;
#endif
SpinLock()
Expand Down
2 changes: 1 addition & 1 deletion redGrapes/task/task_space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace redGrapes
unsigned depth;
Task* parent;

std::shared_mutex active_child_spaces_mutex;
std::shared_timed_mutex active_child_spaces_mutex;
std::vector<std::shared_ptr<TaskSpace>> active_child_spaces;

virtual ~TaskSpace();
Expand Down

0 comments on commit bfa107b

Please sign in to comment.