From 7abc5fe195cfa203d215781e2a04672cebecca1e Mon Sep 17 00:00:00 2001 From: bigbiff Date: Sat, 17 Jan 2015 16:53:12 -0500 Subject: Add cancel backup capability. This will stop the iteration of the partition objects, kill the current twrpTar thread and remove the backup directory. Implement TWAtomicInt class to give us a wrapper that automatically uses mutexes before the read and write to help ensure that the reads and writes will be atomic based on documentation. Change-Id: I645b22bc980a292e9c7202acb24ffd22ebe68c63 --- twrpTar.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'twrpTar.hpp') diff --git a/twrpTar.hpp b/twrpTar.hpp index 799475234..63cb3752a 100644 --- a/twrpTar.hpp +++ b/twrpTar.hpp @@ -45,7 +45,7 @@ class twrpTar { public: twrpTar(); virtual ~twrpTar(); - int createTarFork(const unsigned long long *overall_size, const unsigned long long *other_backups_size); + int createTarFork(const unsigned long long *overall_size, const unsigned long long *other_backups_size, pid_t &fork_pid); int extractTarFork(const unsigned long long *overall_size, unsigned long long *other_backups_size); void setfn(string fn); void setdir(string dir); @@ -80,6 +80,7 @@ private: static void* extractMulti(void *cookie); int tarList(std::vector *TarList, unsigned thread_id); unsigned long long uncompressedSize(string filename, int *archive_type); + static void Signal_Kill(int signum); int Archive_Current_Type; unsigned long long Archive_Current_Size; -- cgit v1.2.3