NNAAMMEE DbLock - lock class SSYYNNOOPPSSIISS ##iinncclluuddee <> iinntt DDbbLLoocckk::::ppuutt((DDbbLLoocckkTTaabb **lltt));; uunnssiiggnneedd iinntt DDbbLLoocckk::::ggeett__lloocckk__iidd(());; vvooiidd DDbbLLoocckk::::sseett__lloocckk__iidd((uunnssiiggnneedd iinntt));; DDBBLLoocckk::::DDbbLLoocckk((uunnssiiggnneedd iinntt));; DDBBLLoocckk::::DDbbLLoocckk(());; DDBBLLoocckk::::DDbbLLoocckk((ccoonnsstt DDbbLLoocckk &&));; DDbbLLoocckk &&DDBBLLoocckk::::ooppeerraattoorr == ((ccoonnsstt DDbbLLoocckk &&));; DDEESSCCRRIIPPTTIIOONN The DB library is a family of classes that provides a mod- ular programming interface to transactions and record-ori- ented file access. The library includes support for transactions, locking, logging and file page caching, as well as various indexed access methods. Many of the classes (e.g., the file page caching class) are useful independent of the other DB classes, although some classes are explicitly based on other classes (e.g., transactions and logging). For a general description of the DB pack- age, see _d_b___i_n_t_r_o(3). This manual page describes the specific details of the locking interface. The DbLock class is used in conjunc- tion with _D_b_L_o_c_k_T_a_b(3) to provide general-purpose locking. While designed to work with the other Db classes, these classes are also useful for more general locking purposes. Locks can be shared between processes. In most cases, when multiple threads or processes are using locking, the deadlock detector, _d_b___d_e_a_d_l_o_c_k(1), should be run. _D_b_L_o_c_k_:_:_p_u_t The _D_b_L_o_c_k_:_:_p_u_t method is a simple interface to the _D_b_L_o_c_k_T_a_b_:_:_v_e_c functionality, and is equivalent to calling the _D_b_L_o_c_k_T_a_b_:_:_v_e_c method with a single element _l_i_s_t array, for which the _o_p field is DB_LOCK_PUT and the _l_o_c_k field is represented by the DbLock object. The _D_b_L_o_c_k_:_:_p_u_t method returns success and failure as described for the _D_b_L_o_c_k_T_a_b_:_:_v_e_c method. _D_b_L_o_c_k_:_:_g_e_t___l_o_c_k___i_d The _D_b_L_o_c_k_:_:_g_e_t___l_o_c_k___i_d method gets the underlying repre- sentation of the lock id. Direct manipulation of the underlying representation is not recommended. _D_b_L_o_c_k_:_:_s_e_t___l_o_c_k___i_d The _D_b_L_o_c_k_:_:_s_e_t___l_o_c_k___i_d method sets the underlying repre- sentation of the lock id. Direct manipulation of the underlying representation is not recommended. Rather, _D_b_L_o_c_k_T_a_b_:_:_g_e_t should be used to initialize locks (see _D_b_L_o_c_k_T_a_b(3)), and the copy constructor and assignment operators can be used to assign to other DbLock objects. EERRRROORRSS Methods marked as returning _e_r_r_n_o will, by default, throw an exception that encapsulates the error information. The default error behavior can be changed, see _D_b_E_x_c_e_p_t_i_o_n(3). The _D_b_L_o_c_k_:_:_p_u_t method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: DbLock::detect(3), fcntl(2), fflush(3), lseek(2), memcpy(3), memset(3), mmap(2), munmap(2), strerror(3), and write(2). In addition, the _D_b_L_o_c_k_:_:_p_u_t method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [EACCES] An attempt was made to release lock held by another locker. [EINVAL] An invalid flag value or parameter was specified. BBUUGGSS If a process dies while holding locks, those locks remain held and are nneevveerr released. In this case, all processes should exit as quickly as possible, so that _d_b___r_e_c_o_v_e_r can be run. SSEEEE AALLSSOO _d_b___a_r_c_h_i_v_e(1), _d_b___c_h_e_c_k_p_o_i_n_t(1), _d_b___d_e_a_d_l_o_c_k(1), _d_b___d_u_m_p(1), _d_b___l_o_a_d(1), _d_b___r_e_c_o_v_e_r(1), _d_b___s_t_a_t(1), _d_b___i_n_t_r_o(3), _d_b___i_n_t_e_r_n_a_l(3), _d_b___t_h_r_e_a_d(3), _D_b(3), _D_b_c(3), _D_b_E_n_v(3), _D_b_E_x_c_e_p_t_i_o_n(3), _D_b_I_n_f_o(3), _D_b_L_o_c_k(3), _D_b_L_o_c_k_T_a_b(3), _D_b_L_o_g(3), _D_b_L_s_n(3), _D_b_M_p_o_o_l(3), _D_b_M_p_o_o_l_F_i_l_e(3), _D_b_t(3), _D_b_T_x_n(3), _D_b_T_x_n_M_g_r(3)