Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 27 for pthread_join (0.34 sec)

  1. src/runtime/testdata/testprogcgo/stackswitch.c

    }
    
    void callStackSwitchCallbackFromThread(void) {
    	pthread_t thread;
    	assert(pthread_create(&thread, NULL, stackSwitchThread, NULL) == 0);
    	assert(pthread_join(thread, NULL) == 0);
    
    	assert(pthread_create(&thread, NULL, stackSwitchThread2, NULL) == 0);
    	assert(pthread_join(thread, NULL) == 0);
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 15:17:33 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/testsanitizers/testdata/tsan15.go

    		if (r < 0)
    			break;
    	}
    	return 0;
    }
    
    static void foo() {
    	pthread_t *th = malloc(sizeof(pthread_t));
    	pthread_t th2;
    	pthread_create(th, 0, thr, 0);
    	pthread_create(&th2, 0, sendthr, th);
    	pthread_join(*th, 0);
    }
    */
    import "C"
    
    import (
    	"time"
    )
    
    //export go_callback
    func go_callback() {}
    
    func main() {
    	go func() {
    		for {
    			C.foo()
    		}
    	}()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 21:14:49 UTC 2024
    - 968 bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/test/issue6997_linux.go

    		c <- C.CancelThread()
    	}()
    
    	select {
    	case r = <-c:
    		if r == 0 {
    			t.Error("pthread finished but wasn't canceled??")
    		}
    	case <-time.After(30 * time.Second):
    		t.Error("hung in pthread_cancel/pthread_join")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 879 bytes
    - Viewed (0)
  4. src/cmd/cgo/internal/test/sigprocmask.go

    	signal.Notify(make(chan os.Signal), syscall.SIGIO)
    	blocked = C.CheckBlocked() != 0
    }
    
    func testSigprocmask(t *testing.T) {
    	if r := C.RunSigThread(); r != 0 {
    		t.Errorf("pthread_create/pthread_join failed: %d", r)
    	}
    	if !blocked {
    		t.Error("Go runtime unblocked SIGIO")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 808 bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testcarchive/testdata/main3.c

    	res = pthread_create(&tid, NULL, provokeSIGPIPE, NULL);
    	if (res != 0) {
    		fprintf(stderr, "pthread_create: %s\n", strerror(res));
    		exit(EXIT_FAILURE);
    	}
    
    	res = pthread_join(tid, NULL);
    	if (res != 0) {
    		fprintf(stderr, "pthread_join: %s\n", strerror(res));
    		exit(EXIT_FAILURE);
    	}
    
    	if (verbose) {
    		printf("calling sigaction\n");
    	}
    
    	memset(&sa, 0, sizeof sa);
    	sa.sa_sigaction = ioHandler;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  6. src/cmd/cgo/internal/test/sigprocmask.c

    int RunSigThread() {
    	int tries;
    	pthread_t thread;
    	int r;
    	struct timespec ts;
    
    	for (tries = 0; tries < 20; tries++) {
    		r = pthread_create(&thread, NULL, &sigthreadfunc, NULL);
    		if (r == 0) {
    			return pthread_join(thread, NULL);
    		}
    		if (r != EAGAIN) {
    			return r;
    		}
    		ts.tv_sec = 0;
    		ts.tv_nsec = (tries + 1) * 1000 * 1000; // Milliseconds.
    		nanosleep(&ts, NULL);
    	}
    	return EAGAIN;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 1K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/testsanitizers/testdata/tsan14.go

        return 0;
    }
    
    static void foo() {
        pthread_t th;
        pthread_attr_t attr;
        pthread_attr_init(&attr);
        pthread_attr_setstacksize(&attr, 256 << 10);
        pthread_create(&th, &attr, thr, 0);
        pthread_join(th, 0);
    }
    */
    import "C"
    
    import (
    	"time"
    )
    
    //export go_callback
    func go_callback() {
    }
    
    func main() {
    	for i := 0; i < 2; i++ {
    		go func() {
    			for {
    				C.foo()
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 17 21:53:11 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  8. src/internal/trace/testdata/testprog/cgo-callback.go

        return 0;
    }
    
    static void foo() {
        pthread_t th;
        pthread_attr_t attr;
        pthread_attr_init(&attr);
        pthread_attr_setstacksize(&attr, 256 << 10);
        pthread_create(&th, &attr, thr, 0);
        pthread_join(th, 0);
    }
    
    static void bar() {
        go_callback2();
    }
    */
    import "C"
    
    import (
    	"log"
    	"os"
    	"runtime"
    	"runtime/trace"
    )
    
    //export go_callback
    func go_callback() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  9. src/runtime/testdata/testprogcgo/raceprof.go

    	for (i = 0; i < 100; i++) {
    		pthread_kill(pthread_self(), SIGPROF);
    		sched_yield();
    	}
    	return 0;
    }
    
    void runRaceprofThread() {
    	pthread_t tid;
    	pthread_create(&tid, 0, raceprofThread, 0);
    	pthread_join(tid, 0);
    }
    */
    import "C"
    
    import (
    	"bytes"
    	"fmt"
    	"runtime"
    	"runtime/pprof"
    	"unsafe"
    )
    
    func init() {
    	register("CgoRaceprof", CgoRaceprof)
    }
    
    func CgoRaceprof() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 24 18:13:14 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/testsanitizers/testdata/tsan13.go

    static void runThreads(int n) {
    	pthread_t ids[64];
    	int i;
    
    	if (n > 64) {
    		n = 64;
    	}
    	for (i = 0; i < n; i++) {
    		pthread_create(&ids[i], NULL, spin, NULL);
    	}
    	for (i = 0; i < n; i++) {
    		pthread_join(ids[i], NULL);
    	}
    }
    */
    import "C"
    
    import (
    	"io"
    	"runtime"
    	"runtime/pprof"
    	"unsafe"
    )
    
    func main() {
    	runtime.SetCgoTraceback(0, unsafe.Pointer(C.tsanTraceback), nil, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.7K bytes
    - Viewed (0)
Back to top