@@ -517,8 +517,19 @@ impl Interpreter {
517
517
let _object_type = context. next ( ) ?;
518
518
let _arg_count = context. next ( ) ?;
519
519
}
520
- Opcode :: Mutex => todo ! ( ) ,
521
- Opcode :: Event => todo ! ( ) ,
520
+ Opcode :: Mutex => {
521
+ let name = context. namestring ( ) ?;
522
+ let sync_level = context. next ( ) ?;
523
+
524
+ let name = name. resolve ( & context. current_scope ) ?;
525
+ self . namespace . lock ( ) . insert ( name, Arc :: new ( Object :: Mutex { sync_level } ) ) ?;
526
+ }
527
+ Opcode :: Event => {
528
+ let name = context. namestring ( ) ?;
529
+
530
+ let name = name. resolve ( & context. current_scope ) ?;
531
+ self . namespace . lock ( ) . insert ( name, Arc :: new ( Object :: Event ) ) ?;
532
+ }
522
533
Opcode :: CondRefOf => todo ! ( ) ,
523
534
Opcode :: LoadTable => todo ! ( ) ,
524
535
Opcode :: Load => todo ! ( ) ,
@@ -806,11 +817,6 @@ impl Interpreter {
806
817
_ => panic ! ( "Stores to objects like {:?} are not yet supported" , target) ,
807
818
} ,
808
819
Argument :: Namestring ( _) => { }
809
- Argument :: UnresolvedObjectPath ( _) => {
810
- // TODO: do we need to attempt to allow this somehow??
811
- todo ! ( "Is this allowed here?" ) ;
812
- }
813
-
814
820
Argument :: ByteData ( _) | Argument :: TrackedPc ( _) | Argument :: PkgLength ( _) => panic ! ( ) ,
815
821
}
816
822
Ok ( ( ) )
0 commit comments