Home GnuPG
Diffusion GpgOL e26e6b58b48e

Locks and more locks

Description

Locks and more locks

* src/mail.cpp (mail_map_lock, uid_map_lock): New locks.
(Mail::Mail, Mail::~Mail, Mail::get_mail_for_item),
(Mail::get_mail_for_uuid, Mail::is_valid_ptr),
(Mail::close_all_mails, Mail::revert_all_mails),
(Mail::revert_all_mails, Mail::wipe_all_mails),
(Mail::set_uuid, Mail::locate_all_crypto_recipients)
(Mail::delete_lock, Mail::delete_unlock): New helpers to
ensure a mail pointer stays valid.
* src/mail.h: Update accordingly.

As the mail object is used from more and more threads
and will soon be used even more for autoencryption
we have to be _very_ careful to minimize / remove race
conditions which could lead to a crash.
For autoencryption we will have async code working
on every new mail.

Prepares:

Details

Provenance
aheineckeAuthored on Jun 20 2018, 1:33 PM
Parents
rO8576131bc84d: Cppinize keycache a bit more
Branches
Unknown
Tags
Unknown
Tasks
T3999: automatically turn on/offer encryption if recipients' keys are known