Auto-commit fuse.cpp

This commit is contained in:
Antonio SJ Musumeci 2026-04-13 18:55:56 -05:00
parent d5a2187713
commit 02da8efbff
37 changed files with 374 additions and 267 deletions

View file

@ -86,6 +86,11 @@ struct AsyncWorker
fuse_msgbuf_t *msgbuf;
msgbuf = msgbuf_alloc();
if(not msgbuf)
{
fmt::println(stderr,"mergerfs: failure to allocate msgbuf, exiting");
return;
}
while(true)
{
@ -141,6 +146,11 @@ struct SyncWorker
fuse_msgbuf_t *msgbuf;
msgbuf = msgbuf_alloc();
if(not msgbuf)
{
fmt::println(stderr,"mergerfs: failure to allocate msgbuf, exiting");
return;
}
while(true)
{
@ -166,31 +176,6 @@ struct SyncWorker
}
};
int
fuse_start_thread(pthread_t *thread_id,
void *(*func)(void *),
void *arg)
{
int res;
sigset_t oldset;
sigset_t newset;
sigfillset(&newset);
pthread_sigmask(SIG_BLOCK,&newset,&oldset);
res = pthread_create(thread_id,NULL,func,arg);
pthread_sigmask(SIG_SETMASK,&oldset,NULL);
if(res != 0)
{
fprintf(stderr,
"fuse: error creating thread: %s\n",
strerror(res));
return -1;
}
return 0;
}
static
int
_calculate_thread_count(const int raw_thread_count_)