C言語なら俺に聞け( ..
[2ch|▼Menu]
183:183
07/05/11 20:29:09
↓のソースで、☆印の行は何か意味があるでしょうか。
 あってもなくても変わらない気がするのですが...
( 環境:Windows Vista , Visual Studio C++ Express Edition )

#include <stdio.h>
#include <windows.h>

#define THREAD_NUM 4
#define DATA_NUM 12

typedef struct _thread_type {
int thread_no;
int *data;
CRITICAL_SECTION *cs;
} thread_arg_t;

void thread_func(void *arg) {
thread_arg_t* targ = (thread_arg_t *)arg;
int i, result;

for (i = 0; i < DATA_NUM; i++) {
// EnterCriticalSection(targ->cs);
result = targ->data[i] + 1;
Sleep(0); ☆
targ->data[i] = result;
// LeaveCriticalSection(targ->cs);
}
}




次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5244日前に更新/240 KB
担当:undef