MCPcopy Create free account
hub / github.com/buke/quickjs-go / SetCanBlock

Method SetCanBlock

runtime.go:664–678  ·  view source on GitHub ↗

SetCanBlock will set the runtime's can block; default is true

(canBlock bool)

Source from the content-addressed store, hash-verified

662
663// SetCanBlock will set the runtime's can block; default is true
664func (r *Runtime) SetCanBlock(canBlock bool) {
665 if r == nil {
666 return
667 }
668 if !r.ensureOwnerAccess() {
669 return
670 }
671 r.mu.RLock()
672 defer r.mu.RUnlock()
673 if r.closed.Load() || r.ref == nil {
674 return
675 }
676
677 C.JS_SetCanBlock(r.ref, C.bool(canBlock))
678}
679
680// SetMemoryLimit the runtime memory limit; if not set, it will be unlimit.
681func (r *Runtime) SetMemoryLimit(limit uint64) {

Calls 2

ensureOwnerAccessMethod · 0.95
LoadMethod · 0.80