diff options
Diffstat (limited to 'src/fuse/cowfile.c')
-rw-r--r-- | src/fuse/cowfile.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/fuse/cowfile.c b/src/fuse/cowfile.c index 5b4eb95..b2df74f 100644 --- a/src/fuse/cowfile.c +++ b/src/fuse/cowfile.c @@ -818,18 +818,7 @@ bool cowfile_init( char *path, const char *image_Name, uint16_t imageVersion, at if ( !createSession( image_Name, imageVersion ) ) { return false; } - createCowStatsFile( path ); - if( pthread_create( &tidCowUploader, NULL, &cowfile_uploader, NULL ) != 0 ) { - logadd( LOG_ERROR, "Could not create cow uploader thread"); - return false; - } - if ( statFile || statStdout ) { - if(pthread_create( &tidStatUpdater, NULL, &cowfile_statUpdater, NULL ) != 0 ) { - logadd( LOG_ERROR, "Could not create stat updater thread"); - return false; - } - } return true; } @@ -936,6 +925,14 @@ bool cowfile_load( char *path, atomic_uint_fast64_t **imageSizePtr, char *server cow.firstL2 = (l2 *)( ( (char *)cow.l1 ) + cow.l1Size ); pthread_mutex_init( &cow.l2CreateLock, NULL ); createCowStatsFile( path ); + return true; +} +/** + * @brief Starts the cow BackgroundThreads which are needed for stats and data upload + * + */ +bool cowfile_startBackgroundThreads() { + if( pthread_create( &tidCowUploader, NULL, &cowfile_uploader, NULL ) != 0 ) { logadd( LOG_ERROR, "Could not create cow uploader thread"); return false; @@ -946,7 +943,6 @@ bool cowfile_load( char *path, atomic_uint_fast64_t **imageSizePtr, char *server return false; } } - return true; } |