代码搜索:pThread
找到约 7,828 项符合「pThread」的源代码
代码结果 7,828
www.eeworm.com/read/179157/9368025
c stress.c
#include
#include
extern void TestEntry();
int main(void)
{
int i = 0;
pthread_t tid1,tid2, tid3;
pthread_t tid4,tid5, tid6;
pthread_attr_t attr;
pthread
www.eeworm.com/read/350337/10749831
cpp test2.cpp
#include
#include
void* pmsg(void* p)
{
char *msg;
msg = (char*)p;
printf("%s ", msg);
}
int main(int argc, char *argv)
{
pthread_t t1, t2;
pthread_attr_t a1, a2;
char *msg1 =
www.eeworm.com/read/210829/15191815
c thmutex.c
#include
#include
#include
#include
void pthread1(void *counter);
void pthread2(void *counter);
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
www.eeworm.com/read/229410/14340265
c mt.c
/***************************************************************************/
/* This code is part of WWW grabber called pavuk */
/* Copyright (c) 1997 - 2001 Stefan Ondre
www.eeworm.com/read/228215/14395847
h rwlock.h
#ifndef __pthread_rwlock_H
#define __pthread_rwlock_H
#include
typedef struct
{
pthread_mutex_t rw_mutex;
pthread_cond_t rw_condreaders;
pthread_cond_t rw_condwriters;
int
www.eeworm.com/read/267540/11175512
txt 互斥锁与条件变量.txt
4.2 互斥锁
互斥锁用来保证一段时间内只有一个线程在执行一段代码。必要性显而易见:假设各个线程向同一个文件顺序写入数据,最后得到的结果一定是灾难性的。
我们先看下面一段代码。这是一个读/写程序,它们公用一个缓冲区,并且我们假定一个缓冲区只能保存一条信息。即缓冲区只有两个状态:有信息或没有信息。
void reader_function ( void );
void write ...
www.eeworm.com/read/175598/9540365
c mutex5.c
/*
* mutex5.c
*
*
* --------------------------------------------------------------------------
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
www.eeworm.com/read/417321/10994449
c mutex5.c
/*
* mutex5.c
*
*
* --------------------------------------------------------------------------
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
www.eeworm.com/read/129924/5966031
h debug_out.h
/* debug_out.h - macros to use for debugging prints in places where calls
to printf() and gang are ill-advised. */
#ifdef PTHREAD_DEBUGGING
#define PTHREAD_DEBUG_WriteStr(S) (void)ma
www.eeworm.com/read/124347/6053544
c exit3.c
/*
* Test for pthread_exit().
*
* Depends on API functions: pthread_create().
*/
#include "test.h"
void *
func(void * arg)
{
pthread_exit(arg);
/* Never reached. */
assert(0);
}
int
main(in