ost::Lockfile(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::Lockfile β€” from the Library Functions Manual ✨

okay bestie, sit down, we're talking about ost::Lockfile(3) today and honestly? she's that girl πŸ’…


πŸŽ€ NAME πŸŽ€

ost::Lockfile β€” this class is used to create a 'named' lock entity that can be used to control access to a resource between multiple processes. no cap. it's the bouncer at the club door of your resources 🫢


🌸 SYNOPSIS 🌸

#include <process.h>

✨ Public Member Functions ✨

  • Lockfile (const char *name) β€” Create a lock under a known name. πŸ‘‘
  • Lockfile () β€” Create a new lock object that can be used to make locks.
  • ~Lockfile () β€” Destroy the current lock and release it. bye bestie πŸ’€
  • bool lock (const char *name) β€” Lock a system-wide name for this process.
  • void unlock (void) β€” Release an acquired lock.
  • bool isLocked (void) β€” Flag if the current process has aqcuired a lock. (yes, that's the original spelling, we don't fix, we preserve 🫑)

πŸ¦‹ Detailed Description πŸ¦‹

This class is used to create a 'named' lock entity that can be used to control access to a resource between multiple processes. literally her whole personality.

The posix implimentation uses a pidfile and the win32 version uses a globally visible mutex. so like, two totally different fits, same energy ✨

also. implimentation. yes. that's how it's spelled up there. we are not the spelling police, we are the detail-preservation police πŸ’–

πŸ‘‘ Author πŸ‘‘

David Sugar dyfet@ostel.com

πŸ”₯ System-wide named lock πŸ”₯


🌈 Constructor & Destructor Documentation 🌈

πŸ’– ost::Lockfile::Lockfile (const char * name)

Create a lock under a known name. iconic behaviour honestly.

Parameters

  • name of system-wide lock to create.

πŸ’– ost::Lockfile::Lockfile ()

Create a new lock object that can be used to make locks. that's it. that's the whole vibe. a little blank canvas 🎨

πŸ’– ost::Lockfile::~Lockfile () [inline]

Destroy the current lock and release it. she's leaving, and she's taking the lock with her πŸ’…


⭐ Member Function Documentation ⭐

🌟 bool ost::Lockfile::isLocked (void)

Flag if the current process has aqcuired a lock.

Returns

  • true if we have the lock. slay. πŸŽ€

🌟 bool ost::Lockfile::lock (const char * name)

Lock a system-wide name for this process. If the lock is successful, return true. If an existing lock was already acquired, release it first. (yes bestie, she cleans up after herself before she takes the new one, we love a considerate queen 🫢)

Returns

  • true if lock successful.

Parameters

  • name system-wide lock to use.

🌟 void ost::Lockfile::unlock (void)

Release an acquired lock. letting it go, moving on, main character energy 🌸


✨ Author ✨

Generated automatically by Doxygen for GNU CommonC++ from the source code.


and that's the whole page, bestie!! πŸ¦‹πŸ’– no cap, every flag, every signature, every typo, all of it preserved with love.

this little fairy tale came to you courtesy of GNU CommonC++, dated Sun Dec 27 2020 β€” sending you off with a kiss and a ost::Lockfile(3) πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from