~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/runtime/cgo/gcc_darwin_386.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
                pthread_key_delete(tofree[i]);
102
102
}
103
103
 
104
 
static void
105
 
xinitcgo(G *g)
 
104
void
 
105
x_cgo_init(G *g)
106
106
{
107
107
        pthread_attr_t attr;
108
108
        size_t size;
115
115
        inittls();
116
116
}
117
117
 
118
 
void (*initcgo)(G*) = xinitcgo;
119
118
 
120
119
void
121
 
libcgo_sys_thread_start(ThreadStart *ts)
 
120
_cgo_sys_thread_start(ThreadStart *ts)
122
121
{
123
122
        pthread_attr_t attr;
124
123
        sigset_t ign, oset;
127
126
        int err;
128
127
 
129
128
        sigfillset(&ign);
130
 
        sigprocmask(SIG_SETMASK, &ign, &oset);
 
129
        pthread_sigmask(SIG_SETMASK, &ign, &oset);
131
130
 
132
131
        pthread_attr_init(&attr);
133
132
        pthread_attr_getstacksize(&attr, &size);
134
133
        ts->g->stackguard = size;
135
134
        err = pthread_create(&p, &attr, threadentry, ts);
136
135
 
137
 
        sigprocmask(SIG_SETMASK, &oset, nil);
 
136
        pthread_sigmask(SIG_SETMASK, &oset, nil);
138
137
 
139
138
        if (err != 0) {
140
139
                fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
153
152
        ts.g->stackbase = (uintptr)&ts;
154
153
 
155
154
        /*
156
 
         * libcgo_sys_thread_start set stackguard to stack size;
 
155
         * _cgo_sys_thread_start set stackguard to stack size;
157
156
         * change to actual guard pointer.
158
157
         */
159
158
        ts.g->stackguard = (uintptr)&ts - ts.g->stackguard + 4096;