~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/runtime/windows/thread.c

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
runtime·osinit(void)
46
46
{
47
47
        runtime·stdcall(runtime·QueryPerformanceFrequency, 1, &timerfreq);
48
 
        runtime·stdcall(runtime·SetConsoleCtrlHandler, 2, runtime·ctrlhandler, 1);
 
48
        runtime·stdcall(runtime·SetConsoleCtrlHandler, 2, runtime·ctrlhandler, (uintptr)1);
49
49
}
50
50
 
51
51
void
81
81
void
82
82
runtime·exit(int32 code)
83
83
{
84
 
        runtime·stdcall(runtime·ExitProcess, 1, code);
 
84
        runtime·stdcall(runtime·ExitProcess, 1, (uintptr)code);
85
85
}
86
86
 
87
87
int32
93
93
        written = 0;
94
94
        switch(fd) {
95
95
        case 1:
96
 
                handle = runtime·stdcall(runtime·GetStdHandle, 1, -11);
 
96
                handle = runtime·stdcall(runtime·GetStdHandle, 1, (uintptr)-11);
97
97
                break;
98
98
        case 2:
99
 
                handle = runtime·stdcall(runtime·GetStdHandle, 1, -12);
 
99
                handle = runtime·stdcall(runtime·GetStdHandle, 1, (uintptr)-12);
100
100
                break;
101
101
        default:
102
102
                return -1;
103
103
        }
104
 
        runtime·stdcall(runtime·WriteFile, 5, handle, buf, n, &written, 0);
 
104
        runtime·stdcall(runtime·WriteFile, 5, handle, buf, (uintptr)n, &written, (uintptr)0);
105
105
        return written;
106
106
}
107
107
 
111
111
{
112
112
        void *event;
113
113
 
114
 
        event = runtime·stdcall(runtime·CreateEvent, 4, 0, 0, 0, 0);
 
114
        event = runtime·stdcall(runtime·CreateEvent, 4, (uintptr)0, (uintptr)0, (uintptr)0, (uintptr)0);
115
115
        if(!runtime·casp(pevent, 0, event)) {
116
116
                // Someone else filled it in.  Use theirs.
117
117
                runtime·stdcall(runtime·CloseHandle, 1, event);
126
126
                initevent(&l->event);
127
127
 
128
128
        if(runtime·xadd(&l->key, 1) > 1)        // someone else has it; wait
129
 
                runtime·stdcall(runtime·WaitForSingleObject, 2, l->event, -1);
 
129
                runtime·stdcall(runtime·WaitForSingleObject, 2, l->event, (uintptr)-1);
130
130
}
131
131
 
132
132
static void
190
190
        USED(g);        // assuming g = m->g0
191
191
        USED(fn);       // assuming fn = mstart
192
192
 
193
 
        thandle = runtime·stdcall(runtime·CreateThread, 6, 0, 0, runtime·tstart_stdcall, m, 0, 0);
 
193
        thandle = runtime·stdcall(runtime·CreateThread, 6, (uintptr)0, (uintptr)0, runtime·tstart_stdcall, m, (uintptr)0, (uintptr)0);
194
194
        if(thandle == 0) {
195
195
                runtime·printf("runtime: failed to create new OS thread (have %d already; errno=%d)\n", runtime·mcount(), runtime·getlasterror());
196
196
                runtime·throw("runtime.newosproc");
219
219
void *
220
220
runtime·stdcall(void *fn, int32 count, ...)
221
221
{
222
 
        return runtime·stdcall_raw(fn, count, (uintptr*)(&count + 1));
 
222
        return runtime·stdcall_raw(fn, count, (uintptr*)&count + 1);
223
223
}
224
224
 
225
225
uintptr