|
GCC Middle and Back End API Reference
|
#include <lockfile.h>
Public Member Functions | |
| lockfile () | |
| lockfile (std::string filename) | |
| lockfile (lockfile const &o) | |
| void | operator= (lockfile o) |
| int | lock_write () |
| int | try_lock_write () |
| int | lock_read () |
| void | unlock () |
| bool | locked () |
Static Public Member Functions | |
| static bool | lockfile_supported () |
Private Attributes | |
| std::string | filename |
| int | fd |
File locking. Copyright (C) 2023-2026 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Used to synchronize across multiple processes.
|
inline |
References fd.
Referenced by ltrans_file_cache::item::item(), lockfile(), lockfile(), ltrans_file_cache::ltrans_file_cache(), and operator=().
|
inline |
References filename, and lockfile().
|
inline |
References filename, and lockfile().
| int lockfile::lock_read | ( | ) |
| int lockfile::lock_write | ( | ) |
|
inline |
References fd, filename, lockfile(), and unlock().
| int lockfile::try_lock_write | ( | ) |
Unique write lock. No other lock can be held on this lockfile. Only locks if this filelock is not locked by any other process. Return whether locking was successful.
References fd, filename, and SEEK_SET.
Referenced by ltrans_file_cache::try_prune().
| void lockfile::unlock | ( | ) |
Unlock all previously placed locks.
Referenced by operator=(), run_gcc(), and ltrans_file_cache::try_prune().
|
private |
Referenced by lock_read(), lock_write(), locked(), lockfile(), operator=(), try_lock_write(), and unlock().
|
private |
Referenced by lock_read(), lock_write(), lockfile(), lockfile(), operator=(), and try_lock_write().