package Ġcn . t urs om . core . deleg ation Ċ Ċ import Ġcn . t urs om . core . unchecked Cast Ċ import Ġkotlin . reflect . K Property 0 Ċ Ċ class ĠThread Local Mutable Deleg ated Field < in ĠT , ĠV >( ĊĠ Ġprivate Ġval Ġthread Local : ĠThread Local < V ?> Ġ= ĠThread Local (), Ċ ) Ġ: ĠMutable Deleg ated Field < T , ĠV ?> Ġ{ ĊĊĠ Ġoverride Ġfun Ġ< K > Ġget ( key : ĠDeleg ated Field Attachment Key < K >): ĠK ? Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( key Ġ== ĠComp anion ) Ġ{ ĊĠĠĠĠĠ Ġthread Local . unchecked Cast () ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġsuper . get ( key ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠsetValue ( value : ĠV ?) Ġ= Ġthread Local . set ( value ) ĊĠ Ġoverride Ġfun ĠgetValue (): ĠV ? Ġ= Ġthread Local . get () ĊĊĠ Ġcompanion Ġobject Ġ: ĠDeleg ated Field Attachment Key < Thread Local <* >> Ġ{ ĊĠĠĠ Ġfun Ġ< T > ĠgetKey () Ġ= Ġthis . unchecked Cast < Deleg ated Field Attachment Key < Thread Local < T >> >() ĊĠĠĠ Ġfun Ġ< T > ĠgetKey ( property : ĠK Property 0 < T >) Ġ= Ġthis . unchecked Cast < Deleg ated Field Attachment Key < Thread Local < T >> >() ĊĠ Ġ} Ċ }