next up previous contents
Next: Reference counts Up: Reference Counting Sessions Previous: Reference Counting Sessions

References

 

A Sessn reference is a pointer to a Sessn. References come in two flavors: permanent and temporary. A permanent reference can be used indefinitely. As long as the holder of a permanent reference does not call xClose on the reference, the holder knows that the pointer will remain valid. Permanent references are returned by xOpen. A Sessn pointer received as a parameter in a function call is a temporary reference. It can only be safely used for the duration of that function call.

A permanent reference may be created from a temporary reference by using the following operation on session:

XkReturn xDuplicate(Sessn session)

For example, xDemux passes a reference to the lower session as a parameter to the upper protocol. If the upper protocol wishes to save this reference beyond the extent of the call, the protocol should call xDuplicate on the session. The protocol can then safely use the reference until it calls xClose.



Larry Peterson
Wed Feb 21 13:58:06 MST 1996