]> git.ipfire.org Git - thirdparty/cups.git/commit
scheduler: Protect MimeDatabase from parallel access (fixes #466) 468/head
authorZdenek Dohnal <zdohnal@redhat.com>
Tue, 6 Sep 2022 14:04:43 +0000 (16:04 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Tue, 6 Sep 2022 14:09:54 +0000 (16:09 +0200)
commit51012526181b5b7d2e8a4bb88998609941b0936d
tree3c1eda67dbe454fd95ef5c2ed55bb5fe984c81ae
parentcd84d7fde692237af4996d4a0e985a3eb4a293f0
scheduler: Protect MimeDatabase from parallel access (fixes #466)

If multiple create_local_bg_thread threads are spawned, they can fight
over MimeDatabase (specifically over MimeDatabase->srcs array), ending
up in SIGSEGV if one thread uses the array, but the other deletes it.

I chose to use RW locks for protecting the pointer - IMHO we benefit
from multiple threads being able to read in parallel.
scheduler/client.c
scheduler/conf.c
scheduler/ipp.c
scheduler/job.c
scheduler/mime.h
scheduler/printers.c