Skip to content

Commit

Permalink
Add friend classes and fix class name typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehpor committed Nov 12, 2024
1 parent 56431e5 commit e8d00f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions catkit_core/SynchronizationConditionVariable.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct SharedStateConditionVariable
class SynchronizationConditionVariable : public SynchronizationBase<SynchronizationConditionVariable, SharedStateConditionVariable>
{
friend SynchronizationBase<SynchronizationConditionVariable, SharedStateConditionVariable>;

public:
void Wait(long timeout_in_ms, std::function<bool()> condition, void (*error_check)());
void Signal();
Expand Down
4 changes: 2 additions & 2 deletions catkit_core/SynchronizationSemaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void SynchronizationSemaphore::CreateImpl(const std::string &id, SharedState *sh
if (m_Semaphore == NULL)
throw std::runtime_error("Something went wrong while creating semaphore.");

shared_data->m_NumReadersWaiting = 0;
shared_state->m_NumReadersWaiting = 0;
}

void SynchronizationSemaphore::OpenImpl(const std::string &id, SharedState *shared_state)
Expand All @@ -82,7 +82,7 @@ void SynchronizationSemaphore::OpenImpl(const std::string &id, SharedState *shar
throw std::runtime_error("Something went wrong while opening semaphore.");
}

void SynchronizationSempahore::CloseImpl()
void SynchronizationSemaphore::CloseImpl()
{
CloseHandle(m_Semaphore);
}
Expand Down
6 changes: 3 additions & 3 deletions catkit_core/SynchronizationSemaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ struct SharedStateSemaphore

class SynchronizationSemaphore : public SynchronizationBase<SynchronizationSemaphore, SharedStateSemaphore>
{
friend SynchronizationBase<SynchronizationSemaphore, SharedStateSemaphore>;

public:
void Wait(long timeout_in_ms, std::function<bool()> condition, void (*error_check)());
void Signal();

void Lock();
void Unlock();

protected:
void CreateImpl(const std::string &id, SharedState *shared_state);
void OpenImpl(const std::string &id, SharedState *shared_state);
void CloseImpl();

HANDLE m_Semaphore;
};
Expand Down

0 comments on commit e8d00f0

Please sign in to comment.