Lines Matching defs:transaction
33 transaction::{Transaction, TransactionFlag, TransactionFlags, TransactionInfo},
257 /// Work item used to deliver error codes to the thread that started a transaction. Stored here
363 /// Fetches the transaction this thread can reply to. If the thread has a pending transaction
364 /// (that it could respond to) but it has also issued a transaction, it must first wait for the
365 /// previously-issued transaction to complete.
369 let transaction = self.current_transaction.take().ok_or(EINVAL)?;
370 if core::ptr::eq(thread, transaction.from.as_ref()) {
371 self.current_transaction = Some(transaction);
374 // Find a new current transaction for this thread.
375 self.current_transaction = transaction.find_from(thread).cloned();
376 Ok(transaction)
379 fn pop_transaction_replied(&mut self, transaction: &DArc<Transaction>) -> bool {
383 if !Arc::ptr_eq(transaction, &old) {
419 /// transaction stack. But if there is local work, we want to return to userspace before we
500 t.debug_print_inner(m, " outgoing transaction ");
503 t.debug_print_inner(m, " incoming transaction ");
506 t.debug_print_inner(m, " bad transaction ");
512 work.debug_print(m, " ", " pending transaction ")?;
531 pub(crate) fn set_current_transaction(&self, transaction: DArc<Transaction>) {
532 self.inner.lock().current_transaction = Some(transaction);
581 /// This must only be called when the thread is not participating in a transaction chain. If it
602 // a transaction and it is not in the process' ready list.
746 // This will be overwritten with the actual fd when the transaction is received.
992 /// This method copies the payload of a transaction into the target process.
996 /// and those objects have to be translated so that they make sense to the target transaction.
1093 binder_debug!(UserError, "got transaction with invalid offset");
1153 while let Ok(transaction) = {
1159 "release transaction {} in, still active",
1160 transaction.debug_id
1164 if !transaction
1166 .deliver_single_reply(reply, &transaction, None)
1171 thread = transaction.from.clone();
1178 transaction: &DArc<Transaction>,
1181 if self.deliver_single_reply(reply, transaction, extended_error) {
1182 transaction.from.unwind_transaction_stack();
1186 /// Delivers a reply to the thread that started a transaction. The reply can either be a
1187 /// reply-transaction or an error code to be delivered instead.
1190 /// transaction stack by completing transactions for threads that are dead.
1194 transaction: &DArc<Transaction>,
1197 if let Ok(transaction) = &reply {
1198 crate::trace::trace_transaction(true, transaction, Some(&self.task));
1199 transaction.set_outstanding(&mut self.process.inner.lock());
1204 if !inner.pop_transaction_replied(transaction) {
1232 /// Determines if the given transaction is the current transaction for this thread.
1233 fn is_current_transaction(&self, transaction: &DArc<Transaction>) -> bool {
1237 Some(current) => Arc::ptr_eq(current, transaction),
1241 /// Determines the current top of the transaction stack. It fails if the top is in another
1243 /// [`None`] if the thread is not currently participating in a transaction stack.
1248 pr_warn_ratelimited!("got new transaction with bad transaction stack\n");
1258 // duration of `transaction()`.
1296 fn transaction(self: &Arc<Self>, cmd: u32, reader: &mut UserSliceReader) -> Result<()> {
1325 "transaction {} to {}:{} failed {:?}, code {} size {}-{}",
1346 // useful in case the transaction failed with BR_TRANSACTION_PENDING_FROZEN.
1360 // TODO: We need to ensure that there isn't a pending transaction in the work queue. How
1368 let transaction = Transaction::new(node_ref, top, self, info)?;
1370 // Check that the transaction stack hasn't changed while the lock was released, then update
1371 // it with the new transaction.
1374 if !transaction.is_stacked_on(&inner.current_transaction) {
1375 binder_debug!(UserError, "got new transaction with bad transaction stack");
1378 inner.current_transaction = Some(transaction.clone_arc());
1384 if let Err(e) = transaction.submit(info) {
1386 // Define `transaction` first to drop it after `inner`.
1387 let transaction;
1389 transaction = inner.current_transaction.take().unwrap();
1390 inner.current_transaction = transaction.clone_next();
1401 binder_debug!(UserError, "got reply transaction with no transaction stack");
1408 "got reply transaction with bad transaction stack"
1416 // We need to complete the transaction even if we cannot complete building the reply.
1432 // the sender know that the transaction has completed (with an error in this case).
1456 let transaction = Transaction::new(node_ref, None, self, info)?;
1467 match transaction.submit(info) {
1490 self.transaction(cmd, &mut reader)?;
1756 "{}transaction error: {}\n",