Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewWrapperWithLock (0.13 sec)

  1. test/typeparam/issue48337a.dir/main.go

    // Copyright 2021 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    import "./a"
    
    func main() {
    	obj := a.NewWrapperWithLock("this file does import sync")
    	obj.PrintWithLock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 284 bytes
    - Viewed (0)
  2. test/typeparam/issue48337a.dir/a.go

    // license that can be found in the LICENSE file.
    
    package a
    
    import (
    	"fmt"
    	"sync"
    )
    
    type WrapperWithLock[T any] interface {
    	PrintWithLock()
    }
    
    func NewWrapperWithLock[T any](value T) WrapperWithLock[T] {
    	return &wrapperWithLock[T]{
    		Object: value,
    	}
    }
    
    type wrapperWithLock[T any] struct {
    	Lock   sync.Mutex
    	Object T
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 17 19:50:04 UTC 2021
    - 551 bytes
    - Viewed (0)
Back to top