File:  [Coherent Logic Development] / freem / src / locktab.h
Revision 1.4: download - view: text, annotated - select for diffs
Thu May 1 21:02:31 2025 UTC (3 months ago) by snw
Branches: MAIN
CVS tags: HEAD
Documentation updates

    1: /*
    2:  *   $Id: locktab.h,v 1.4 2025/05/01 21:02:31 snw Exp $
    3:  *    lock table data structures
    4:  *
    5:  *  
    6:  *   Author: Serena Willis <snw@coherent-logic.com>
    7:  *    Copyright (C) 1998 MUG Deutschland
    8:  *    Copyright (C) 2021, 2025 Coherent Logic Development LLC
    9:  *
   10:  *
   11:  *   This file is part of FreeM.
   12:  *
   13:  *   FreeM is free software: you can redistribute it and/or modify
   14:  *   it under the terms of the GNU Affero Public License as published by
   15:  *   the Free Software Foundation, either version 3 of the License, or
   16:  *   (at your option) any later version.
   17:  *
   18:  *   FreeM is distributed in the hope that it will be useful,
   19:  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   20:  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   21:  *   GNU Affero Public License for more details.
   22:  *
   23:  *   You should have received a copy of the GNU Affero Public License
   24:  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
   25:  *
   26:  *   $Log: locktab.h,v $
   27:  *   Revision 1.4  2025/05/01 21:02:31  snw
   28:  *   Documentation updates
   29:  *
   30:  *   Revision 1.3  2025/03/09 19:50:47  snw
   31:  *   Second phase of REUSE compliance and header reformat
   32:  *
   33:  *
   34:  * SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
   35:  * SPDX-License-Identifier: AGPL-3.0-or-later
   36:  **/
   37: 
   38: #if !defined(__FREEM_LOCKTAB_H)
   39: # define __FREEM_LOCKTAB_H
   40: 
   41: #define NREF_MAXLEN 800
   42: 
   43: typedef struct locktab_ent_t {
   44: 
   45:     char namespace[255];
   46:     char nref[NREF_MAXLEN];
   47: 
   48:     int tp_level;
   49:     pid_t owner_job;
   50:     int ct;
   51:     
   52:     struct locktab_ent_t *next;
   53:     
   54: } locktab_ent_t;
   55: 
   56: /* function prototypes */
   57: extern void locktab_init(void);
   58: extern void lock(char *lockarg, long time_out, char type);
   59: extern void locktab_increment(char *key, long lck_timeout, short old_lock);
   60: extern void locktab_decrement(char *key, long lck_timeout);
   61: extern void locktab_unlock_all(void);
   62: extern void locktab_unlock_all_by_pid(const pid_t target_pid);
   63: extern locktab_ent_t *locktab_find(char *key);
   64: extern locktab_ent_t *locktab_insert(char *key);
   65: extern int locktab_count(char *key);
   66: extern unsigned long locktab_pages(void);
   67: extern unsigned long locktab_bytes(void);
   68: extern short locktab_get_sem(void);
   69: extern void locktab_release_sem(void);
   70: extern void locktab_dump(void);
   71: 
   72: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>