# Section 6.7.23:
Attach Statement

Attachment is the way in which a Sather program can associate a new thread with a lock and some computation. The result is that a thread can initiate some actions and, when completion is required can wait for the created thread to complete. See the prevasive abstract class $ATTACH for the requirements of the associated lock.

#### Concrete Syntax

attach statement = expression, Do_Attach_SY, expression ;

#### Abstract Syntax

This statement type makes use of the built-in routine with the 'Attach' identity. This is defined as in the following invariant -

Predefined_Call ::
id : token
args : Feature
impl : Feature
rval : [Value_Expression] ;
inv mk_Predefined_Call(expid,args,imp,val) ==
expid = Attach
and len args.args = 2
and imp.impl = attach_built_in(args(1),args(2))
and val = nil

#### Static Semantics

The first argument has to be of a sub-type of the pervasive abstract class $ATTACH. The second must be a method call.

TO BE DONE

#### Dynamic Semantics

The attach statement associates a new thread for the first argument with a method call which is its second argument.

attach_built_in(self : SAME, lock : $ATTACH, funct : ROUT{ANY})
post ???

TO BE DONE

| Specification Index |  | Language Index |  | Section 6 Index

Comments or enquiries should be made to Keith Hopper . Page last modified: Wednesday, 31 May 2000. |