SetCanBlock will set the runtime's can block; default is true
(canBlock bool)
| 662 | |
| 663 | // SetCanBlock will set the runtime's can block; default is true |
| 664 | func (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. |
| 681 | func (r *Runtime) SetMemoryLimit(limit uint64) { |