mariadb/innobase/usr/usr0sess.c
unknown 3fbf812f78 Remove unneeded module "com"
BitKeeper/deleted/.del-Makefile.am~2b013aa835a140c4:
  Delete: innobase/com/Makefile.am
BitKeeper/deleted/.del-com0com.c~473a1f0f440ce91b:
  Delete: innobase/com/com0com.c
BitKeeper/deleted/.del-com0shm.c~6a16f0c3d81de1f:
  Delete: innobase/com/com0shm.c
BitKeeper/deleted/.del-makefilewin~3e26f0df100887f2:
  Delete: innobase/com/makefilewin
BitKeeper/deleted/.del-com0com.h~533a7eaa16ec585a:
  Delete: innobase/include/com0com.h
BitKeeper/deleted/.del-com0com.ic~671e309916e285b:
  Delete: innobase/include/com0com.ic
BitKeeper/deleted/.del-com0shm.h~5f3df7c04221b0fe:
  Delete: innobase/include/com0shm.h
BitKeeper/deleted/.del-com0shm.ic~f827cfca1603fa6b:
  Delete: innobase/include/com0shm.ic
innobase/configure.in:
  Remove com/Makefile
innobase/include/Makefile.am:
  Remove com*.h
innobase/include/usr0sess.h:
  Remove unused communication functions
innobase/include/usr0sess.ic:
  Remove unused communication functions
innobase/include/usr0types.h:
  Remove sess_sys_t and sess_sig_t
innobase/usr/usr0sess.c:
  Remove unused functions
innobase/dict/dict0crea.c:
  Remove unneeded params of que_fork_start_command()
innobase/include/que0que.h:
  Remove unneeded params of que_fork_start_command()
innobase/row/row0mysql.c:
  Remove unneeded params of que_fork_start_command()
innobase/include/srv0srv.h:
  Remove references to the com module
innobase/srv/srv0srv.c:
  Remove references to the com module
  Remove unused vars srv_n_{com,worker}_threads
  Make some global vars static
innobase/que/que0que.c:
  Remove references to odbc
  Add #ifdef UNIV_SYNC_DEBUG around some ut_ad()
  Remove unneeded params of que_fork_start_command()
  Remove unreachable code
  Output diagnostics to stderr, not stdout
innobase/include/trx0trx.h:
  Remove unneeded params of trx_sig_send() and trx_sig_reply()
innobase/trx/trx0trx.c:
  Remove unneeded params of trx_sig_send() and trx_sig_reply()
  Remove params of sess_open()
innobase/srv/srv0start.c:
  Remove reference to com0com.h
  Remove call to sess_sys_init_at_db_start()
innobase/trx/trx0purge.c:
  Remove references to the com module
  Remove params of sess_open()
  Remove unneeded params of que_fork_start_command()
innobase/trx/trx0roll.c:
  Remove params of sess_open()
  Remove unneeded params of que_fork_start_command()
  Remove unneeded params of trx_sig_send() and trx_sig_reply()
2004-03-11 12:55:28 +02:00

86 lines
1.7 KiB
C

/******************************************************
Sessions
(c) 1996 Innobase Oy
Created 6/25/1996 Heikki Tuuri
*******************************************************/
#include "usr0sess.h"
#ifdef UNIV_NONINL
#include "usr0sess.ic"
#endif
#include "trx0trx.h"
/*************************************************************************
Closes a session, freeing the memory occupied by it. */
static
void
sess_close(
/*=======*/
sess_t* sess); /* in, own: session object */
/*************************************************************************
Opens a session. */
sess_t*
sess_open(void)
/*===========*/
/* out, own: session object */
{
sess_t* sess;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
sess = mem_alloc(sizeof(sess_t));
sess->state = SESS_ACTIVE;
sess->trx = trx_create(sess);
UT_LIST_INIT(sess->graphs);
return(sess);
}
/*************************************************************************
Closes a session, freeing the memory occupied by it. */
static
void
sess_close(
/*=======*/
sess_t* sess) /* in, own: session object */
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(sess->trx == NULL);
mem_free(sess);
}
/*************************************************************************
Closes a session, freeing the memory occupied by it, if it is in a state
where it should be closed. */
ibool
sess_try_close(
/*===========*/
/* out: TRUE if closed */
sess_t* sess) /* in, own: session object */
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
if (UT_LIST_GET_LEN(sess->graphs) == 0) {
sess_close(sess);
return(TRUE);
}
return(FALSE);
}