mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
cleanup pthreads
This commit is contained in:
@@ -281,7 +281,6 @@ unsafe fn start_threads(
|
|||||||
std::thread::JoinHandle<()>,
|
std::thread::JoinHandle<()>,
|
||||||
std::thread::JoinHandle<()>,
|
std::thread::JoinHandle<()>,
|
||||||
) {
|
) {
|
||||||
println!("staring thread");
|
|
||||||
run_threads = 1;
|
run_threads = 1;
|
||||||
let context = c.clone();
|
let context = c.clone();
|
||||||
let h1 = std::thread::spawn(move || {
|
let h1 = std::thread::spawn(move || {
|
||||||
@@ -519,7 +518,6 @@ unsafe fn main_0(mut argc: libc::c_int, mut argv: *mut *mut libc::c_char) -> lib
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if !(*cmd.offset(0isize) as libc::c_int == 0i32) {
|
if !(*cmd.offset(0isize) as libc::c_int == 0i32) {
|
||||||
let ctx = ctx.clone();
|
|
||||||
let mut execute_result: *mut libc::c_char = dc_cmdline(ctx, &cmdline);
|
let mut execute_result: *mut libc::c_char = dc_cmdline(ctx, &cmdline);
|
||||||
if !execute_result.is_null() {
|
if !execute_result.is_null() {
|
||||||
printf(
|
printf(
|
||||||
|
|||||||
@@ -5,10 +5,7 @@ use crate::constants::Event;
|
|||||||
use crate::dc_context::dc_context_t;
|
use crate::dc_context::dc_context_t;
|
||||||
use crate::x::*;
|
use crate::x::*;
|
||||||
|
|
||||||
pub use libc::{
|
pub use libc::{dirent, tm, DIR, FILE};
|
||||||
dirent, pthread_attr_t, pthread_cond_t, pthread_condattr_t, pthread_mutex_t,
|
|
||||||
pthread_mutexattr_t, pthread_t, tm, DIR, FILE,
|
|
||||||
};
|
|
||||||
pub use libsqlite3_sys::*;
|
pub use libsqlite3_sys::*;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
27
src/x.rs
27
src/x.rs
@@ -505,33 +505,6 @@ extern "C" {
|
|||||||
|
|
||||||
pub fn dc_strbuilder_catf(_: *mut dc_strbuilder_t, format: *const libc::c_char, _: ...);
|
pub fn dc_strbuilder_catf(_: *mut dc_strbuilder_t, format: *const libc::c_char, _: ...);
|
||||||
pub fn dc_mprintf(format: *const libc::c_char, _: ...) -> *mut libc::c_char;
|
pub fn dc_mprintf(format: *const libc::c_char, _: ...) -> *mut libc::c_char;
|
||||||
|
|
||||||
// -- Pthread
|
|
||||||
|
|
||||||
pub fn pthread_create(
|
|
||||||
_: *mut pthread_t,
|
|
||||||
_: *const pthread_attr_t,
|
|
||||||
_: Option<unsafe extern "C" fn(_: *mut libc::c_void) -> *mut libc::c_void>,
|
|
||||||
_: *mut libc::c_void,
|
|
||||||
) -> libc::c_int;
|
|
||||||
pub fn pthread_join(_: pthread_t, _: *mut *mut libc::c_void) -> libc::c_int;
|
|
||||||
pub fn pthread_cond_signal(_: *mut pthread_cond_t) -> libc::c_int;
|
|
||||||
pub fn pthread_cond_timedwait(
|
|
||||||
_: *mut pthread_cond_t,
|
|
||||||
_: *mut pthread_mutex_t,
|
|
||||||
_: *const timespec,
|
|
||||||
) -> libc::c_int;
|
|
||||||
pub fn pthread_mutex_lock(_: *mut pthread_mutex_t) -> libc::c_int;
|
|
||||||
pub fn pthread_mutex_unlock(_: *mut pthread_mutex_t) -> libc::c_int;
|
|
||||||
pub fn pthread_cond_destroy(_: *mut pthread_cond_t) -> libc::c_int;
|
|
||||||
pub fn pthread_cond_init(_: *mut pthread_cond_t, _: *const pthread_condattr_t) -> libc::c_int;
|
|
||||||
pub fn pthread_cond_wait(_: *mut pthread_cond_t, _: *mut pthread_mutex_t) -> libc::c_int;
|
|
||||||
pub fn pthread_mutex_destroy(_: *mut pthread_mutex_t) -> libc::c_int;
|
|
||||||
pub fn pthread_mutex_init(
|
|
||||||
_: *mut pthread_mutex_t,
|
|
||||||
_: *const pthread_mutexattr_t,
|
|
||||||
) -> libc::c_int;
|
|
||||||
pub fn pthread_self() -> pthread_t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
|||||||
Reference in New Issue
Block a user