Skip to content

Commit

Permalink
Remove non-const TV play lock functions
Browse files Browse the repository at this point in the history
The lock functions in tv_play.cpp are now all const.
For two lock functions there was both a const and a non-const variant
with identical function bodies.
It appears that there is no need for the non-const variants; all code
compiles without warnings against the const variants.
Therefore the non-const variants have been removed.
  • Loading branch information
kmdewaal committed Jul 30, 2021
1 parent 70d90a6 commit 9437fcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
14 changes: 2 additions & 12 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -10129,33 +10129,23 @@ OSD *TV::GetOSDL()
return nullptr;
}

void TV::ReturnOSDLock()
void TV::ReturnOSDLock() const
{
if (m_player)
m_player->UnlockOSD();
m_playerContext.UnlockDeletePlayer(__FILE__, __LINE__);
}

void TV::GetPlayerWriteLock()
void TV::GetPlayerWriteLock() const
{
m_playerLock.lockForWrite();
}

void TV::GetPlayerReadLock()
{
m_playerLock.lockForRead();
}

void TV::GetPlayerReadLock() const
{
m_playerLock.lockForRead();
}

void TV::ReturnPlayerLock()
{
m_playerLock.unlock();
}

void TV::ReturnPlayerLock() const
{
m_playerLock.unlock();
Expand Down
6 changes: 2 additions & 4 deletions mythtv/libs/libmythtv/tv_play.h
Expand Up @@ -262,11 +262,9 @@ class MTV_PUBLIC TV : public TVPlaybackState, public MythTVMenuItemDisplayer, pu

// Lock handling
OSD* GetOSDL();
void ReturnOSDLock();
void GetPlayerWriteLock();
void GetPlayerReadLock();
void ReturnOSDLock() const;
void GetPlayerWriteLock() const;
void GetPlayerReadLock() const;
void ReturnPlayerLock();
void ReturnPlayerLock() const;

// Other toggles
Expand Down

0 comments on commit 9437fcc

Please sign in to comment.