D1(fprintf(debug_file,"Re-starting raw data recording, using the same state file, next will be %s, state->path='%s'\n",get_state_path(state),state->path));
D0(fprintf(debug_file,"Re-starting raw data recording, using the same state file, next will be %s, state->path='%s'\n",get_state_path(state),state->path));
D1(syslog(LOG_INFO,"Re-starting raw data recording, next will be %s",get_state_path(state)));
D0(syslog(LOG_INFO,"Re-starting raw data recording, next will be %s",get_state_path(state)));
}
}
}
}
}else{
}else{
D1(fprintf(debug_file,"Starting file system recording to %s\n",state->path));
D0(fprintf(debug_file,"Starting file system recording to %s\n",state->path));
D1(syslog(LOG_INFO,"Starting file system recording to %s",state->path));
D0(syslog(LOG_INFO,"Starting file system recording to %s",state->path));
}
}
doubledtime_stamp;
doubledtime_stamp;
...
@@ -409,14 +409,23 @@ int camogm_start(camogm_state *state, bool restart)
...
@@ -409,14 +409,23 @@ int camogm_start(camogm_state *state, bool restart)
pthread_cond_wait(¶ms->writer_cond,¶ms->writer_mutex);// They are called with mutex locked by the calling thread or undefined behaviour will result.
pthread_cond_wait(¶ms->writer_cond,¶ms->writer_mutex);// They are called with mutex locked by the calling thread or undefined behaviour will result.
// || (!params->write_waits_sig[1 - this_thread_index] && !params->write_go[this_thread_index]) // other write thread is not waiting, not already set go
// || (!params->write_waits_sig[1 - this_thread_index] && !params->write_go[this_thread_index]) // other write thread is not waiting, not already set go
)&&!params->exit_write_threads){
)&&!params->exit_write_threads){
// Wake up main thread while waiting
// Wake up main thread while waiting
#if 1
#if 1
if(get_num_empty(params)>=(NUM_NEED_EMPTY+2)){
if(get_num_empty(params)>=(NUM_NEED_EMPTY+2)){
pthread_cond_signal(¶ms->main_cond);// signal to main thread that prepares data
pthread_cond_signal(¶ms->main_cond);// signal to main thread that prepares data
D3(fprintf(debug_file,"%s_w00.2_: signaling main while waiting to start write [%d%d:%d%d:%d%d] @ %07d\n", \
D3(fprintf(debug_file,"%s_w00.2_: signaling main while waiting to start write [%d%d:%d%d:%d%d] @ %07d\n", \
pthread_cond_wait(¶ms->writer_cond,¶ms->writer_mutex);// They are called with mutex locked by the calling thread or undefined behaviour will result.
pthread_cond_wait(¶ms->writer_cond,¶ms->writer_mutex);// They are called with mutex locked by the calling thread or undefined behaviour will result.
pthread_cond_wait(¶ms->writer_cond,¶ms->writer_mutex);// They are called with mutex locked by the calling thread or undefined behaviour will result.