DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

tc_tlock(D3oddi)


tc_tlock, tc_tunlock, tc_ctlock, tc_ctunlock -- lock and unlock portions of a tty structure

Syntax

#include <sys/tty.h>

int tc_tlock(struct tp) critical code int tc_tunlock(struct tp, ...)

int tc_ctlock(struct tp) critical code int tc_tunlock(struct tp, ...)

Description

The tc_tlock( ) functions provide mutual exclusion for critical code sections that access a tty structure. tc_tlock( ) sets a lock unconditionally. tc_ctlock( ) sets a lock only if one does not currently exist; if a lock already exists, it returns immediately.

Arguments


tp
Pointer to the appropriate tty structure.

Return values

tc_tlock( ) and tc_ctlock( ) return the previous spl value.

tc_tunlock( ) does not return a value.

Usage

Context and synchronization

Non-blockable, interrupt, user, or blockable context.

Hardware applicability

All

Version applicability

oddi: 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

SVR5 TTY drivers are implemented as STREAMS drivers so there is no direct parallel to these functions. See ``Spin locks (DDI)'' in HDK Technical Reference for information about the locking facilities that are supported for DDI drivers.

References

lockb(D3oddi)

``Notes and examples for multithreaded TTY drivers'' in Developing SCO OpenServer 5 kernel drivers.


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005