2011-10-08 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / libgo / runtime / go-gomaxprocs.c
blob65146c501208ce5f7528e536ef46fcb636f2b245
1 /* go-gomaxprocs.c -- runtime.GOMAXPROCS.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
7 /* This is the runtime.GOMAXPROCS function. This currently does
8 nothing, since each goroutine runs in a separate thread anyhow. */
10 extern int GOMAXPROCS (int) asm ("libgo_runtime.runtime.GOMAXPROCS");
12 static int set = 1;
14 int
15 GOMAXPROCS (int n)
17 int ret;
19 ret = set;
20 if (n > 0)
21 set = n;
22 return ret;