Skip to content

Commit

Permalink
struct thread_data: Remove unused lock field
Browse files Browse the repository at this point in the history
  • Loading branch information
rinon committed Feb 2, 2024
1 parent 68dd817 commit ad963b8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
12 changes: 0 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ use libc::pthread_attr_init;
use libc::pthread_attr_setstacksize;
use libc::pthread_attr_t;
use libc::pthread_join;
use libc::pthread_mutex_destroy;
use libc::pthread_mutex_init;
use libc::pthread_mutexattr_t;
use libc::pthread_t;
use std::cmp;
use std::ffi::c_char;
Expand Down Expand Up @@ -377,13 +374,6 @@ pub(crate) unsafe fn rav1d_open(c_out: &mut *mut Rav1dContext, s: &Rav1dSettings
(*t).c = c;
*BitDepth16::select_mut(&mut (*t).cf) = Align64([0; 32 * 32]);
if (*c).n_tc > 1 as c_uint {
if pthread_mutex_init(
&mut (*t).task_thread.td.lock,
0 as *const pthread_mutexattr_t,
) != 0
{
return error(c, c_out, &mut thread_attr);
}
(*t).task_thread.td.cond = Condvar::new();
if pthread_create(
&mut (*t).task_thread.td.thread,
Expand All @@ -392,7 +382,6 @@ pub(crate) unsafe fn rav1d_open(c_out: &mut *mut Rav1dContext, s: &Rav1dSettings
t as *mut c_void,
) != 0
{
pthread_mutex_destroy(&mut (*t).task_thread.td.lock);
return error(c, c_out, &mut thread_attr);
}
(*t).task_thread.td.inited = 1 as c_int;
Expand Down Expand Up @@ -937,7 +926,6 @@ unsafe fn close_internal(c_out: &mut *mut Rav1dContext, flush: c_int) {
break;
}
pthread_join((*pf).task_thread.td.thread, 0 as *mut *mut c_void);
pthread_mutex_destroy(&mut (*pf).task_thread.td.lock);
n_0 = n_0.wrapping_add(1);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/thread_data.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use libc::pthread_mutex_t;
use libc::pthread_t;
use std::ffi::c_int;
use std::sync::Condvar;
Expand All @@ -7,6 +6,5 @@ use std::sync::Condvar;
pub struct thread_data {
pub thread: pthread_t,
pub cond: Condvar,
pub lock: pthread_mutex_t,
pub inited: c_int,
}

0 comments on commit ad963b8

Please sign in to comment.