码迷,mamicode.com
首页 >  
搜索关键字:pthread    ( 1177个结果
googletest安装与使用
简介 googletest是Google公司开发的一款跨平台的c++测试框架。 依赖 Bazel或者CMake(通常用cmake) 支持c++11标准的编译器 安装 下载 git clone https://github.com/google/googletest.git 编译 cd googlet ...
分类:其他好文   时间:2020-06-21 09:55:58    阅读次数:189
pthread_mutex_lock源码分析
直接把注释写到代码中: 1 int 2 __pthread_mutex_lock (pthread_mutex_t *mutex) 3 { 4 unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex); 5 6 //安全检查 7 LIBC_PROB ...
分类:其他好文   时间:2020-06-20 21:54:01    阅读次数:156
获取进程ID和线程ID ---- getpid、pthread_self
获取进程ID: 原型: #include <unistd.h>pid_t getpid(void); 返回调用进程的进程ID。 获取线程ID: 原型: #include <pthread.h>pthread_t pthread_self(void); 返回调用线程的线程ID。 ...
分类:编程语言   时间:2020-06-19 16:14:13    阅读次数:93
pthread_create() 函数详解
pthread_create是类Unix操作系统(Unix、Linux、Mac OS X等)的创建线程的函数。它的功能是创建线程(实际上就是确定调用该线程函数的入口点),在线程创建以后,就开始运行相关的线程函数。 头文件: #include<pthread.h> 函数原型: int pthread_ ...
分类:其他好文   时间:2020-06-19 16:10:58    阅读次数:52
线程同步
互斥锁(互斥量) 创建互斥锁 pthread_mutex_t mutex; 初始化互斥锁 pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* attr); 销毁互斥锁 pthread_mutex_unlock(p ...
分类:编程语言   时间:2020-06-13 00:08:25    阅读次数:67
qt 中使用pthread
qt有自己的线程实现方式,但有时候我们由于某些原因,会用到pthread来实现多线程。 我把自己看到过的pthread使用方法记下来。如果你有更好的方法,或觉得此方法有什么缺点,请在评论区指出。 这个类去掉了一些冗余代码,编译时可能出现小错误。 CRecvJson.cpp 1 #include "R ...
分类:其他好文   时间:2020-06-10 12:45:03    阅读次数:128
iOS 多线程与线程安全(二)
iOS 中实现线程安全 实现线程安全可以通过加锁、单线程访问等方式。 iOS 中常用的几种锁: os_unfair_lock pthread_mutex dispatch_semaphore NSLock NSRecursiveLock NSCondition NSConditionLock @sy ...
分类:移动开发   时间:2020-06-09 00:00:51    阅读次数:216
mac安装go环境
下载pkg文件 https://golang.google.cn/dl/ sudo vim /etc/profile 11 export GOROOT=/usr/local/go 12 export GOPATH=${GOROOT}/gopath 13 export PATH=$PATH:${GOR ...
分类:系统相关   时间:2020-06-05 20:57:54    阅读次数:185
CMake解决c++11的phread库问题:undefined reference to `pthread_create’
方法一 PROJECT(HELLO) set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -std=c++11") AUX_SOURCE_DIRECTORY(. SRC_LIST) ADD_EXECUTABLE(hello ${SRC_LIST}) 从cmake的CMak ...
分类:编程语言   时间:2020-05-30 15:43:04    阅读次数:85
windows api进程创建
一、createprocess BOOL CreateProcess( LPCTSTR lpApplicationName, // name of executable module //要创建的进程名称 LPTSTR lpCommandLine, // command line string // ...
分类:Windows程序   时间:2020-05-24 20:51:34    阅读次数:133
1177条   上一页 1 2 3 4 5 6 ... 118 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!