Fhernd

lockColecciones.cs

Sep 10th, 2014
3,404
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.70 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Threading;
  4.  
  5. namespace Recetas.CSharp.R0414
  6. {
  7.     public sealed class lockColecciones
  8.     {
  9.         // Instancia `Object` para el bloqueo concurrente:
  10.         private static Object objBloqueante = new Object();
  11.        
  12.         // Lista contenedora de cadenas:
  13.         private static ArrayList listaCadenas = new ArrayList();
  14.        
  15.         // Contador acceso lista:
  16.         private static int contadorAcceso = 0;
  17.        
  18.         public static void Main()
  19.         {
  20.             Console.Title = "Demostración Acceso Concurrente en Colecciones";
  21.             Console.WriteLine ();
  22.        
  23.             // Agregación de cadenas al objeto `listaCadenas`:
  24.             listaCadenas.Add ("Experiencias");
  25.             listaCadenas.Add ("Construcción");
  26.             listaCadenas.Add ("Software");
  27.             listaCadenas.Add ("xCSw");
  28.            
  29.             // Crea 10 instancias de `Thread` para acceder y leer el contenido del
  30.             // objeto ArrayList:
  31.             for (int i = 1; i <= 10; ++i)
  32.             {
  33.                 Thread t = new Thread( AccederLista );
  34.                 t.Name = String.Format ("Thread-{0}", i.ToString());
  35.                 t.Start();
  36.             }
  37.         }
  38.        
  39.         public static void AccederLista()
  40.         {
  41.             lock (objBloqueante)
  42.             {
  43.                 Console.WriteLine ("El thread `{0}` accedió al elemento `{1}`.",
  44.                     Thread.CurrentThread.Name,
  45.                     listaCadenas[contadorAcceso%4]
  46.                 );
  47.                
  48.                 Thread.Sleep (1000);
  49.                
  50.                 ++contadorAcceso;
  51.             }
  52.         }
  53.     }
  54. }
Advertisement
Comments
  • # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 38% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without any verification from Swapzone — instant swap).
Add Comment
Please, Sign In to add comment