netatalk  4.6.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
idle_worker.c File Reference
#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <stdatomic.h>
#include <string.h>
#include <time.h>
#include <atalk/logger.h>
#include <atalk/util.h>
#include <atalk/queue.h>
#include "dircache.h"
#include "directory.h"
#include "idle_worker.h"

Data Structures

struct  [struct].iw_stat

Macros

#define IW_WAKE_MS   10
#define IW_SPIN_ITERATIONS   128
#define IW_WAIT_SLEEP_NS   100000L
#define IW_CPU_RELAX()
#define IW_STAT_INC(field)

Functions

int iw_init (void)
void iw_grant (void)
void iw_revoke (void)
void iw_revoke_signal_safe (void)
void iw_shutdown (void)
void iw_note_work (void)
int iw_grant_active (void)
int iw_is_active (void)
void iw_log_stats (void)

Variables

static atomic_int iw_has_work = 0
static atomic_int iw_can_work = 0
static atomic_int iw_is_working = 0
static atomic_int iw_shutdown_flag = 0
static pthread_t iw_tid
static int iw_started = 0
static int iw_granted = 0
static struct  iw_stat

Macro Definition Documentation

◆ IW_CPU_RELAX

#define IW_CPU_RELAX ( )
Value:
__asm__ __volatile__("" ::: "memory")

◆ IW_SPIN_ITERATIONS

#define IW_SPIN_ITERATIONS   128

◆ IW_STAT_INC

#define IW_STAT_INC ( field)
Value:
atomic_fetch_add_explicit(&iw_stat.field, 1, memory_order_relaxed)
static struct @266052375364073142203257326044224031355360137364 iw_stat

◆ IW_WAIT_SLEEP_NS

#define IW_WAIT_SLEEP_NS   100000L

◆ IW_WAKE_MS

#define IW_WAKE_MS   10

Function Documentation

◆ iw_grant()

void iw_grant ( void )

◆ iw_grant_active()

int iw_grant_active ( void )

◆ iw_init()

int iw_init ( void )

◆ iw_is_active()

int iw_is_active ( void )

◆ iw_log_stats()

void iw_log_stats ( void )

◆ iw_note_work()

void iw_note_work ( void )

◆ iw_revoke()

void iw_revoke ( void )

◆ iw_revoke_signal_safe()

void iw_revoke_signal_safe ( void )

◆ iw_shutdown()

void iw_shutdown ( void )

Variable Documentation

◆ iw_can_work

atomic_int iw_can_work = 0
static

◆ iw_granted

int iw_granted = 0
static

◆ iw_has_work

atomic_int iw_has_work = 0
static

◆ iw_is_working

atomic_int iw_is_working = 0
static

◆ iw_shutdown_flag

atomic_int iw_shutdown_flag = 0
static

◆ iw_started

int iw_started = 0
static

◆ iw_stat

struct [struct].iw_stat iw_stat

◆ iw_tid

pthread_t iw_tid
static