feat: Pause IO for BackupProvider (#4182)

This makes the BackupProvider automatically invoke pause-io while it
is needed.

It needed to make the guard independent from the Context lifetime to
make this work.  Which is a bit sad.
This commit is contained in:
Floris Bruynooghe
2023-03-20 19:57:17 +01:00
committed by GitHub
parent e04efdbd94
commit 35f50a8965
4 changed files with 21 additions and 23 deletions

View File

@@ -2644,10 +2644,6 @@ void dc_str_unref (char* str);
/**
* Creates an object for sending a backup to another device.
*
* Before calling this function IO must be stopped using dc_accounts_stop_io()
* or dc_stop_io() so that no changes to the blobs or database are happening.
* IO should only be restarted once dc_backup_provider_wait() has returned.
*
* The backup is sent to through a peer-to-peer channel which is bootstrapped
* by a QR-code. The backup contains the entire state of the account
* including credentials. This can be used to setup a new device.
@@ -2708,9 +2704,7 @@ char* dc_backup_provider_get_qr_svg (const dc_backup_provider_t* backup_provider
/**
* Waits for the sending to finish.
*
* This is a blocking call and should only be called once. Once this function
* returns IO can be started again using dc_accounts_start_io() or
* dc_start_io().
* This is a blocking call and should only be called once.
*
* @memberof dc_backup_provider_t
* @param backup_provider The backup provider object as created by